New Webrev (23.1) pushed

Peter Jones peter.jones at Sun.COM
Thu Nov 8 00:01:48 UTC 2007


On Tue, Nov 06, 2007 at 07:01:22PM +0100, Jean-Christophe Collet wrote:

> That being said, I'm sad to announce the version 23.1 was very short lived. 
> I just pushed 23.2 and it has some significant changes:
>
> - Support for 'hg foutgoing' (That was a nasty one, it seems to work in my 
> tests but I wouldn't be surprised if there are bugs in that code)
> - fixed the '-b' option
> - Added color coding for filenames: Black for modified files, Green for new 
> files, and Red for deleted files
> - Changed the HTML of the index page to be easier to read
>
> Feedback welcome.

Many thanks for your efforts with webrev for Mercurial.  A few
comments/questions about the latest version (some or all of which may
well be misunderstandings on my part-- and I'm not familiar with
forests yet to understand how they might apply to them either):

It now uses "sort -g", but /usr/bin/sort on my Solaris 10 box doesn't
support "-g", wouldn't "-n" be good enough here?

If I understand the latest support for automatically generating the
file list from "hg outgoing", both the file list and the diffs (if no
"-r") are generated relative to the lowest-numbered revision in the
outgoing list.  That seems fine if no changesets have been pulled
since the first unpushed commit, but if changesets have been pulled
from the parent (and merged), those files/diffs get included too,
which I don't think would be the typical desire-- I'm hoping for a
file list like the familiar Teamware "putback -n" behavior, which I
think would involve comparing the status of the repository relative to
latest changeset shared with its parent (but with comments listed from
every changeset in the outgoing list that affected a given file).
Does that sound reasonable/feasible?

I was hoping that I could manually achieve this effect by specifying
the "latest changeset shared with the parent" using "-r", but when
"-r" is used with no file list, it seems that the file list is still
generated based on the "hg outgoing" (or if empty, "hg status")
algorithm, which was surprising to me-- I would expect it to generate
the file list based on the status of the repository relative to the
specified revision, in the "-r" case?

I tried an explicit file list too, but when an explicit file list is
given, it doesn't make any attempt to accumulate multiple changeset
comments per file, rather just including the comments for the latest
changeset affecting each given file (I think).  I might expect the
comment accumulation behavior to be orthogonal to whether an explicit
file list is given (like, it would always include comments from all
changesets in the outgoing list affecting a given file).

More about changeset comments: in the case described above where I
have pulled changesets from the parent and merged with committed but
unpushed changesets, even though I want diffs against the latest
changeset shared with the parent, I still want comments from all of
the outgoing changesets (not just, say, the comments from later merge
changesets), so that seems to suggest a need to use "hg outgoing" even
when "-r" is used and the file list is based on the specified
revision-- (or else maybe a different revision could be specified for
the purposes of comment accumulation?).

FWIW (not much I expect), below are diffs vs. version 23.2 for crude
hacking I did to serve an immediate (non-JDK) need: file list is
generated relative to specified revision when "-r" is used, and "hg
outgoing" is executed even when an explicit file list is provided (in
order to get comment accumulation)-- and there is another kludge to
only include comments from the outgoing changesets, not changesets
pulled from the parent (I thought that "hg log --follow-first" might
help with that, but it didn't seem to).  And no consideration for
forests...

Cheers,
-- Peter


diff -bu /java/jdk/bin/webrev ~/bin/webrev
--- /java/jdk/bin/webrev        Tue Nov  6 12:47:23 2007
+++ /home/pj23592/bin/webrev    Wed Nov  7 16:10:13 2007
@@ -1160,7 +1160,14 @@
            fi
            if [ -z "$active" ] ; then
             if [[ -n $FIRST_CREV ]] then
-               comm=`hg log --rev $FIRST_CREV:tip --template 'rev {rev} : {desc}\n' $logf`
+#              comm=`hg log --rev $FIRST_CREV:tip --template 'rev {rev} : {desc}\n' $logf`
+               comm=""
+               for rev in $ALL_CREV; do
+                   tmpcomm=`hg log --rev $rev --follow --template 'rev {rev} : {desc}\n' $logf`
+                   if [[ -n $tmpcomm ]]; then
+                       comm="$comm\n$tmpcomm"
+                   fi
+               done
             else
                comm=`hg log -l1 --template '{desc}\n' $logf`
             fi
@@ -1572,10 +1579,9 @@
     if [ -n "$forestflag" ]; then
        flist_from_mercurial_forest
     else
-        if [ -z "$Nflag" ]; then
-           print " File list from hg outgoing $PWS ..."
-           FIRST_CREV=`hg outgoing -q --template '{rev}\n' $OUTPWS | sort -g | head -1`
-            if  [[ -n $FIRST_CREV ]]; then
+       if [ -n "$rflag" ]; then
+           STATUS_REV="--rev $PARENT_REV"
+       elif  [[ -n $FIRST_CREV ]]; then
                 OUTREV=`expr $FIRST_CREV - 1`
                 STATUS_REV="--rev $OUTREV"
                HG_LIST_FROM_COMMIT=1
@@ -1584,7 +1590,6 @@
                print "\n No outgoing, perhaps you haven't commited."
                print " File list from hg status -mard ...\c"
             fi
-        fi
        # First let's list all the modified or deleted files
 
        hg status $STATUS_REV -mdn > $FLIST
@@ -2093,6 +2098,15 @@
     if [[ -z "$OUTPWS" ]]; then
        OUTPWS=`hg path default 2>/dev/null`
     fi 
+
+    #
+    # determine revisions not in parent (unless -N was used)
+    #
+    if [ -z "$Nflag" ]; then
+       print " File list from hg outgoing $PWS ..."
+       ALL_CREV=`hg outgoing -q --template '{rev}\n' $OUTPWS | sort -n`
+       FIRST_CREV=`hg outgoing -q --template '{rev}\n' $OUTPWS | sort -n | head -1`
+    fi
 fi
 
 if [[ -n $lflag ]]; then



More information about the build-dev mailing list