From magnus.ihse.bursie at oracle.com Wed Nov 5 12:49:16 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 05 Nov 2014 13:49:16 +0100 Subject: webrev -f not working? Message-ID: <545A1CCC.4050103@oracle.com> I tried using webrev -N -f with open changes in the top repo and in the jdk repo, and it didn't work. The path to the jdk repo got mangled, and I got errors like this: *** Error: file not in parent or child abort: cannot follow file not in parent revision: "jd/make/gensrc/GensrcIcons.gmk" jd/make/gensrc/GensrcIcons.gmk The keen eye notes "jd/" instead of "jdk/". It seems that the output from "hg tstatus" which is like: [/localhome/hg/jdk9-dev-ALT]: M common/autoconf/basics.m4 [/localhome/hg/jdk9-dev-ALT/jaxws]: [/localhome/hg/jdk9-dev-ALT/jdk]: M make/gensrc/GensrcIcons.gmk is incorrectly parsed, resulting in the tree name "jd" instead of "jdk" (and "jaxw" for "jaxws" etc). I have a patch which solves the problem for me (inlined below), but I'm a bit bewildered. This error must have been present since the support for trees were added. Why have this not been discovered? Have the tstatus output changed? Is this some local configuration difference for my setup? diff --git a/webrev.ksh b/webrev.ksh --- a/webrev.ksh +++ b/webrev.ksh @@ -1420,7 +1420,7 @@ # the AWK code which still tries to handle both cases # hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-1); next} $1 != "" {n=index($1,tree); if (n != 1) { printf("%s/%s\n",tree,$1)} /Magnus From daniel.fuchs at oracle.com Wed Nov 5 13:43:56 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 05 Nov 2014 14:43:56 +0100 Subject: webrev -f not working? In-Reply-To: <545A1CCC.4050103@oracle.com> References: <545A1CCC.4050103@oracle.com> Message-ID: <545A299C.4020604@oracle.com> Hi Magnus, I'm curious - on which OS are you running? The line in question was modified by me when I changed webrev to use trees instead of forest - and I'm regularly using webrev -fN on Mac. best regards, -- daniel On 05/11/14 13:49, Magnus Ihse Bursie wrote: > I tried using webrev -N -f with open changes in the top repo and in the > jdk repo, and it didn't work. The path to the jdk repo got mangled, and > I got errors like this: > > *** Error: file not in parent or child > abort: cannot follow file not in parent revision: > "jd/make/gensrc/GensrcIcons.gmk" > jd/make/gensrc/GensrcIcons.gmk > > The keen eye notes "jd/" instead of "jdk/". It seems that the output > from "hg tstatus" which is like: > [/localhome/hg/jdk9-dev-ALT]: > M common/autoconf/basics.m4 > > [/localhome/hg/jdk9-dev-ALT/jaxws]: > > [/localhome/hg/jdk9-dev-ALT/jdk]: > M make/gensrc/GensrcIcons.gmk > > is incorrectly parsed, resulting in the tree name "jd" instead of "jdk" > (and "jaxw" for "jaxws" etc). > > I have a patch which solves the problem for me (inlined below), but I'm > a bit bewildered. This error must have been present since the support > for trees were added. Why have this not been discovered? Have the > tstatus output changed? Is this some local configuration difference for > my setup? > > diff --git a/webrev.ksh b/webrev.ksh > --- a/webrev.ksh > +++ b/webrev.ksh > @@ -1420,7 +1420,7 @@ > # the AWK code which still tries to handle both cases > # > hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-1); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > > > > /Magnus From magnus.ihse.bursie at oracle.com Wed Nov 5 13:57:13 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Wed, 05 Nov 2014 14:57:13 +0100 Subject: webrev -f not working? In-Reply-To: <545A299C.4020604@oracle.com> References: <545A1CCC.4050103@oracle.com> <545A299C.4020604@oracle.com> Message-ID: <545A2CB9.1070304@oracle.com> On 2014-11-05 14:43, Daniel Fuchs wrote: > Hi Magnus, > > I'm curious - on which OS are you running? Ubuntu. magnusi at sthihse3:~$ uname -a Linux sthihse3 3.13.0-39-generic #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux magnusi at sthihse3:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.1 LTS Release: 14.04 Codename: trusty magnusi at sthihse3:~$ > The line in question was modified by me when I changed webrev to > use trees instead of forest - and I'm regularly using > webrev -fN on Mac. Does the output from hg tstat look the same to you? I.e., like this: [/localhome/hg/jdk9-dev-ALT]: M common/autoconf/basics.m4 [/localhome/hg/jdk9-dev-ALT/jaxws]: [/localhome/hg/jdk9-dev-ALT/jdk]: M make/gensrc/GensrcIcons.gmk When reading the code, I can't really understand why the old code could ever have worked on a output like that. /Magnus > > best regards, > > -- daniel > > On 05/11/14 13:49, Magnus Ihse Bursie wrote: >> I tried using webrev -N -f with open changes in the top repo and in the >> jdk repo, and it didn't work. The path to the jdk repo got mangled, and >> I got errors like this: >> >> *** Error: file not in parent or child >> abort: cannot follow file not in parent revision: >> "jd/make/gensrc/GensrcIcons.gmk" >> jd/make/gensrc/GensrcIcons.gmk >> >> The keen eye notes "jd/" instead of "jdk/". It seems that the output >> from "hg tstatus" which is like: >> [/localhome/hg/jdk9-dev-ALT]: >> M common/autoconf/basics.m4 >> >> [/localhome/hg/jdk9-dev-ALT/jaxws]: >> >> [/localhome/hg/jdk9-dev-ALT/jdk]: >> M make/gensrc/GensrcIcons.gmk >> >> is incorrectly parsed, resulting in the tree name "jd" instead of "jdk" >> (and "jaxw" for "jaxws" etc). >> >> I have a patch which solves the problem for me (inlined below), but I'm >> a bit bewildered. This error must have been present since the support >> for trees were added. Why have this not been discovered? Have the >> tstatus output changed? Is this some local configuration difference for >> my setup? >> >> diff --git a/webrev.ksh b/webrev.ksh >> --- a/webrev.ksh >> +++ b/webrev.ksh >> @@ -1420,7 +1420,7 @@ >> # the AWK code which still tries to handle both cases >> # >> hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v >> "hgroot=$hgroot" ' >> - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,0,length(tree)-2); next} >> + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,0,length(tree)-1); next} >> $1 != "" {n=index($1,tree); >> if (n != 1) >> { printf("%s/%s\n",tree,$1)} >> >> >> >> /Magnus > From daniel.fuchs at oracle.com Wed Nov 5 14:28:50 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 05 Nov 2014 15:28:50 +0100 Subject: webrev -f not working? In-Reply-To: <545A2CB9.1070304@oracle.com> References: <545A1CCC.4050103@oracle.com> <545A299C.4020604@oracle.com> <545A2CB9.1070304@oracle.com> Message-ID: <545A3422.5030203@oracle.com> On 05/11/14 14:57, Magnus Ihse Bursie wrote: > When reading the code, I can't really understand why the old code could > ever have worked on a output like that. Hi Magnus, If I apply your patch on my machine then I get things like: jdk]/src/java.logging/share/classes/java/util/logging/LogManager.java ^ notice the closing bracket. I wonder - could that be a cr versus crlf thing? best regards -- daniel From daniel.fuchs at oracle.com Wed Nov 5 16:43:43 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Wed, 05 Nov 2014 17:43:43 +0100 Subject: webrev -f not working? In-Reply-To: <545A3422.5030203@oracle.com> References: <545A1CCC.4050103@oracle.com> <545A299C.4020604@oracle.com> <545A2CB9.1070304@oracle.com> <545A3422.5030203@oracle.com> Message-ID: <545A53BF.8040506@oracle.com> Hi Magnus, Here is a small testcase: $ echo '[blah/blah]' | gawk '{print substr($1,2,length($1)-1);}' blah/blah] $ echo '[blah/blah]' | gawk '{print substr($1,2,length($1)-2);}' blah/blah I suspect you won't get the same result on your machine :-( I wonder what could be causing the difference? best regards, -- daniel On 05/11/14 15:28, Daniel Fuchs wrote: > On 05/11/14 14:57, Magnus Ihse Bursie wrote: >> When reading the code, I can't really understand why the old code could >> ever have worked on a output like that. > > Hi Magnus, > > If I apply your patch on my machine then I get things like: > > jdk]/src/java.logging/share/classes/java/util/logging/LogManager.java > ^ > notice the closing bracket. > > I wonder - could that be a cr versus crlf thing? > > best regards > > -- daniel From magnus.ihse.bursie at oracle.com Fri Nov 7 07:29:39 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 07 Nov 2014 08:29:39 +0100 Subject: webrev -f not working? In-Reply-To: <545A53BF.8040506@oracle.com> References: <545A1CCC.4050103@oracle.com> <545A299C.4020604@oracle.com> <545A2CB9.1070304@oracle.com> <545A3422.5030203@oracle.com> <545A53BF.8040506@oracle.com> Message-ID: <545C74E3.30600@oracle.com> On 2014-11-05 17:43, Daniel Fuchs wrote: > Hi Magnus, > > Here is a small testcase: > > $ echo '[blah/blah]' | gawk '{print substr($1,2,length($1)-1);}' > blah/blah] > $ echo '[blah/blah]' | gawk '{print substr($1,2,length($1)-2);}' > blah/blah > > I suspect you won't get the same result on your machine :-( But I do. But here's the trick, try: magnusi at sthihse3:~$ echo '[blah/blah]' | awk '{print substr($1,0,length($1)-2);}' [blah/bl magnusi at sthihse3:~$ echo '[blah/blah]' | awk '{print substr($1,1,length($1)-2);}' [blah/bla I'm using nawk. While both gawk and nawk use 1 as the index for the first position, using 0 exposes different behaviours. Gawk, according to the manual, will interpret everything < 1 as 1. Nawk, on the other hand, apparently interprets a position 0 as a "-1". So here's an updated patch that will probably work for you as well as for me: diff --git a/webrev.ksh b/webrev.ksh --- a/webrev.ksh +++ b/webrev.ksh @@ -1420,7 +1420,7 @@ # the AWK code which still tries to handle both cases # hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); next} $1 != "" {n=index($1,tree); if (n != 1) { printf("%s/%s\n",tree,$1)} /Magnus From magnus.ihse.bursie at oracle.com Fri Nov 7 07:43:00 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 07 Nov 2014 08:43:00 +0100 Subject: RFR: CODETOOLS-7901088 webrev -f does not work on nawk Message-ID: <545C7804.4080403@oracle.com> Webrev -f does not work when using nawk, due to an incorrect substr based on 0 instead of 1 as index to the first position. (See prior discussion on webrev-dev). Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901088 Patch inline: diff --git a/webrev.ksh b/webrev.ksh --- a/webrev.ksh +++ b/webrev.ksh @@ -1420,7 +1420,7 @@ # the AWK code which still tries to handle both cases # hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); next} $1 != "" {n=index($1,tree); if (n != 1) { printf("%s/%s\n",tree,$1)} /Magnus From daniel.fuchs at oracle.com Fri Nov 7 09:40:14 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 07 Nov 2014 10:40:14 +0100 Subject: RFR: CODETOOLS-7901088 webrev -f does not work on nawk In-Reply-To: <545C7804.4080403@oracle.com> References: <545C7804.4080403@oracle.com> Message-ID: <545C937E.50109@oracle.com> Hi Magnus, Thanks for finding the issue! I see the same mistake in the function 'outgoing_from_mercurial_forest' and twice again in the function fstatus - so it seems there are a few other places to modify: ----------------------------- diff --git a/webrev.ksh b/webrev.ksh --- a/webrev.ksh +++ b/webrev.ksh @@ -1306,7 +1306,7 @@ function outgoing_from_mercurial_forest /^comparing/ {next} /^no changes/ {next} /^searching/ {next} - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); if (tree == "") { tree="."; } trees[ntree++] = tree; revs[tree]=-1; @@ -1420,7 +1420,7 @@ function fstatus # the AWK code which still tries to handle both cases # hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); next} $1 != "" {n=index($1,tree); if (n != 1) { printf("%s/%s\n",tree,$1)} @@ -1464,7 +1464,7 @@ function fstatus # hg tstatus -aC $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); next} /^A .*/ {n=index($2,tree); if (n != 1) { printf("A %s/%s\n",tree,$2)} @@ -1504,7 +1504,7 @@ function fstatus done done hg tstatus -rn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v "hgroot=$hgroot" ' - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,0,length(tree)-2); next} + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); tree=substr(tree,1,length(tree)-2); next} $1 != "" {n=index($1,tree); if (n != 1) { printf("%s/%s\n",tree,$1)} ----------------------------- The machine I am currently on doesn't work well with trees (it has an old Mercurial) - I will test your patch in a few moments on a more recent system and will let you know the result! best regards, -- daniel On 11/7/14 8:43 AM, Magnus Ihse Bursie wrote: > Webrev -f does not work when using nawk, due to an incorrect substr > based on 0 instead of 1 as index to the first position. (See prior > discussion on webrev-dev). > > Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901088 > Patch inline: > > diff --git a/webrev.ksh b/webrev.ksh > --- a/webrev.ksh > +++ b/webrev.ksh > @@ -1420,7 +1420,7 @@ > # the AWK code which still tries to handle both cases > # > hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > > /Magnus > From daniel.fuchs at oracle.com Fri Nov 7 09:43:10 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 07 Nov 2014 10:43:10 +0100 Subject: RFR: CODETOOLS-7901088 webrev -f does not work on nawk In-Reply-To: <545C937E.50109@oracle.com> References: <545C7804.4080403@oracle.com> <545C937E.50109@oracle.com> Message-ID: <545C942E.10403@oracle.com> Oh - and you should update the version number as well: - WEBREV_UPDATED=25.6-hg+openjdk.java.net + WEBREV_UPDATED=25.7-hg+openjdk.java.net best regards, -- daniel On 11/7/14 10:40 AM, Daniel Fuchs wrote: > Hi Magnus, > > Thanks for finding the issue! > I see the same mistake in the function 'outgoing_from_mercurial_forest' > and twice again in the function fstatus - so it seems there are a few > other places to modify: > > ----------------------------- > diff --git a/webrev.ksh b/webrev.ksh > --- a/webrev.ksh > +++ b/webrev.ksh > @@ -1306,7 +1306,7 @@ function outgoing_from_mercurial_forest > /^comparing/ {next} > /^no changes/ {next} > /^searching/ {next} > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); > if (tree == "") { tree="."; } > trees[ntree++] = tree; > revs[tree]=-1; > @@ -1420,7 +1420,7 @@ function fstatus > # the AWK code which still tries to handle both cases > # > hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > @@ -1464,7 +1464,7 @@ function fstatus > # > > hg tstatus -aC $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > /^A .*/ {n=index($2,tree); > if (n != 1) > { printf("A %s/%s\n",tree,$2)} > @@ -1504,7 +1504,7 @@ function fstatus > done > done > hg tstatus -rn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > ----------------------------- > > The machine I am currently on doesn't work well with trees > (it has an old Mercurial) - I will test your patch in a few moments > on a more recent system and will let you know the result! > > best regards, > > -- daniel > > On 11/7/14 8:43 AM, Magnus Ihse Bursie wrote: >> Webrev -f does not work when using nawk, due to an incorrect substr >> based on 0 instead of 1 as index to the first position. (See prior >> discussion on webrev-dev). >> >> Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901088 >> Patch inline: >> >> diff --git a/webrev.ksh b/webrev.ksh >> --- a/webrev.ksh >> +++ b/webrev.ksh >> @@ -1420,7 +1420,7 @@ >> # the AWK code which still tries to handle both cases >> # >> hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v >> "hgroot=$hgroot" ' >> - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,0,length(tree)-2); next} >> + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,1,length(tree)-2); next} >> $1 != "" {n=index($1,tree); >> if (n != 1) >> { printf("%s/%s\n",tree,$1)} >> >> /Magnus >> > From daniel.fuchs at oracle.com Fri Nov 7 11:33:28 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Fri, 07 Nov 2014 12:33:28 +0100 Subject: RFR: CODETOOLS-7901088 webrev -f does not work on nawk In-Reply-To: <545C937E.50109@oracle.com> References: <545C7804.4080403@oracle.com> <545C937E.50109@oracle.com> Message-ID: <545CAE08.5010509@oracle.com> Hi Magnus, With the below changes webrev is working satisfactorily on my machine - which has gawk. Please note that I'm not a (R)eviewer for CODE-TOOLS. best regards, -- daniel On 07/11/14 10:40, Daniel Fuchs wrote: > Hi Magnus, > > Thanks for finding the issue! > I see the same mistake in the function 'outgoing_from_mercurial_forest' > and twice again in the function fstatus - so it seems there are a few > other places to modify: > > ----------------------------- > diff --git a/webrev.ksh b/webrev.ksh > --- a/webrev.ksh > +++ b/webrev.ksh > @@ -1306,7 +1306,7 @@ function outgoing_from_mercurial_forest > /^comparing/ {next} > /^no changes/ {next} > /^searching/ {next} > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); > if (tree == "") { tree="."; } > trees[ntree++] = tree; > revs[tree]=-1; > @@ -1420,7 +1420,7 @@ function fstatus > # the AWK code which still tries to handle both cases > # > hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > @@ -1464,7 +1464,7 @@ function fstatus > # > > hg tstatus -aC $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > /^A .*/ {n=index($2,tree); > if (n != 1) > { printf("A %s/%s\n",tree,$2)} > @@ -1504,7 +1504,7 @@ function fstatus > done > done > hg tstatus -rn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v > "hgroot=$hgroot" ' > - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,0,length(tree)-2); next} > + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); > tree=substr(tree,1,length(tree)-2); next} > $1 != "" {n=index($1,tree); > if (n != 1) > { printf("%s/%s\n",tree,$1)} > ----------------------------- > > The machine I am currently on doesn't work well with trees > (it has an old Mercurial) - I will test your patch in a few moments > on a more recent system and will let you know the result! > > best regards, > > -- daniel > > On 11/7/14 8:43 AM, Magnus Ihse Bursie wrote: >> Webrev -f does not work when using nawk, due to an incorrect substr >> based on 0 instead of 1 as index to the first position. (See prior >> discussion on webrev-dev). >> >> Bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901088 >> Patch inline: >> >> diff --git a/webrev.ksh b/webrev.ksh >> --- a/webrev.ksh >> +++ b/webrev.ksh >> @@ -1420,7 +1420,7 @@ >> # the AWK code which still tries to handle both cases >> # >> hg tstatus -mdn $FSTAT_OPT 2>/dev/null | $FILTER | $AWK -v >> "hgroot=$hgroot" ' >> - /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,0,length(tree)-2); next} >> + /^\[.*\]:$/ {tree=substr($1,length(hgroot)+3); >> tree=substr(tree,1,length(tree)-2); next} >> $1 != "" {n=index($1,tree); >> if (n != 1) >> { printf("%s/%s\n",tree,$1)} >> >> /Magnus >> > From patrick at reini.net Fri Nov 14 22:12:04 2014 From: patrick at reini.net (Patrick Reinhart) Date: Fri, 14 Nov 2014 23:12:04 +0100 Subject: Creating webrev under Windows/cygwin fails Message-ID: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> Hi there, Has anyone some tips to create a webrev under Windows? In my case the creation fails using the following command (in the JDK root directory) mksh make/scripts/webrev.ksh -o /cygdrive/c/dev The following output is produced: SCM detected: mercurial No outgoing, perhaps you haven't commited. Workspace: C:/dev/jdk8u-dev Compare against: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/ Output to: /cygdrive/c/dev/webrev Output Files: make/scripts/webrev.ksh[2471]: cd: /cygdrive/c/dev/jdk8u-dev/C:/dev/jdk8u-dev/common/autoconf: No such file or directory abort: cannot follow file not in parent revision: "generated-configure.sh" common/autoconf/generated-configure.sh make/scripts/webrev.ksh[2471]: cd: /cygdrive/c/dev/jdk8u-dev/C:/dev/jdk8u-dev/common/autoconf: No such file or directory *** Error: file not in parent or child Seem as the base directory is taken somehow twice. Did I something wrong here? The same command under Linux does work without any problems,,, Patrick From daniel.fuchs at oracle.com Sat Nov 15 14:02:56 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Sat, 15 Nov 2014 15:02:56 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> Message-ID: <54675D10.8030501@oracle.com> Hi, I will make a guess that the root cause is a mix between cygwin paths & windows paths: Workspace: C:/dev/jdk8u-dev Output to: /cygdrive/c/dev/webrev I would suggest trying to get 'hg root' return /cygdrive/c/dev/webrev and see if that fixes the issue. It's just a guess however. best regards, -- daniel On 11/14/14 11:12 PM, Patrick Reinhart wrote: > Hi there, > > Has anyone some tips to create a webrev under Windows? In my case the creation fails using the following command (in the JDK root directory) > > mksh make/scripts/webrev.ksh -o /cygdrive/c/dev > > The following output is produced: > > SCM detected: mercurial > > No outgoing, perhaps you haven't commited. > Workspace: C:/dev/jdk8u-dev > Compare against: http://hg.openjdk.java.net/jdk8u/jdk8u-dev/ > Output to: /cygdrive/c/dev/webrev > Output Files: > make/scripts/webrev.ksh[2471]: cd: /cygdrive/c/dev/jdk8u-dev/C:/dev/jdk8u-dev/common/autoconf: No such file or directory > abort: cannot follow file not in parent revision: "generated-configure.sh" > common/autoconf/generated-configure.sh > make/scripts/webrev.ksh[2471]: cd: /cygdrive/c/dev/jdk8u-dev/C:/dev/jdk8u-dev/common/autoconf: No such file or directory > *** Error: file not in parent or child > > Seem as the base directory is taken somehow twice. Did I something wrong here? The same command under Linux does work without any problems,,, > > Patrick From daniel.fuchs at oracle.com Sat Nov 15 15:27:24 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Sat, 15 Nov 2014 16:27:24 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: <54675D10.8030501@oracle.com> References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> <54675D10.8030501@oracle.com> Message-ID: <546770DC.2040507@oracle.com> On 11/15/14 3:02 PM, Daniel Fuchs wrote: > I would suggest trying to get 'hg root' return > > /cygdrive/c/dev/webrev ^^^^^^^^^^^^^^^^^^^ I meant: /cygdrive/c/dev/jdk8u-dev of course. best regards, -- daniel From patrick at reini.net Sat Nov 15 16:58:05 2014 From: patrick at reini.net (Patrick Reinhart) Date: Sat, 15 Nov 2014 17:58:05 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: <546770DC.2040507@oracle.com> References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> <54675D10.8030501@oracle.com> <546770DC.2040507@oracle.com> Message-ID: Hi Daniel, As you correctly pointed out the actual value returned by "hg root" is indeed "c:/dev/jdk8u-dev". Sorry, this might be a bit of a dumb question, but how can I actually change that? Patrick > Am 15.11.2014 um 16:27 schrieb Daniel Fuchs : > > On 11/15/14 3:02 PM, Daniel Fuchs wrote: >> I would suggest trying to get 'hg root' return >> >> /cygdrive/c/dev/webrev > ^^^^^^^^^^^^^^^^^^^ > I meant: > > /cygdrive/c/dev/jdk8u-dev > > of course. > > best regards, > > -- daniel From daniel.fuchs at oracle.com Sun Nov 16 18:42:01 2014 From: daniel.fuchs at oracle.com (Daniel Fuchs) Date: Sun, 16 Nov 2014 19:42:01 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> <54675D10.8030501@oracle.com> <546770DC.2040507@oracle.com> Message-ID: <5468EFF9.1040900@oracle.com> On 11/15/14 5:58 PM, Patrick Reinhart wrote: > Hi Daniel, > > As you correctly pointed out the actual value returned by "hg root" is indeed "c:/dev/jdk8u-dev". > > Sorry, this might be a bit of a dumb question, but how can I actually change that? Hi Patrick, I'm not sure you can actually change it, but I suspect you could attempt to create a new workspace that has a cygwin-like path. Possibly by opening a cygwin shell, cd ing to /cygwin/c/dev and invoking hg clone from there? Note: I'm not sure that will work - but this is what I would try. best regards, -- daniel > > > Patrick > > >> Am 15.11.2014 um 16:27 schrieb Daniel Fuchs : >> >> On 11/15/14 3:02 PM, Daniel Fuchs wrote: >>> I would suggest trying to get 'hg root' return >>> >>> /cygdrive/c/dev/webrev >> ^^^^^^^^^^^^^^^^^^^ >> I meant: >> >> /cygdrive/c/dev/jdk8u-dev >> >> of course. >> >> best regards, >> >> -- daniel From magnus.ihse.bursie at oracle.com Fri Nov 21 17:42:14 2014 From: magnus.ihse.bursie at oracle.com (Magnus Ihse Bursie) Date: Fri, 21 Nov 2014 18:42:14 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> <54675D10.8030501@oracle.com> <546770DC.2040507@oracle.com> Message-ID: <546F7976.7010502@oracle.com> On 2014-11-15 17:58, Patrick Reinhart wrote: > Hi Daniel, > > As you correctly pointed out the actual value returned by "hg root" is indeed "c:/dev/jdk8u-dev". > > Sorry, this might be a bit of a dumb question, but how can I actually change that? This indicates that you have used another "hg" binary than the one provided by cygwin, e.g. from TortoiseHG. This is not recommended, and will in general fail in weird ways like this. I recommend that you install mercurial from cygwin, and run hg clone with that instead. You can verify that your hg is correct by "which hg", it should be "/usr/bin/hg" or "/bin/hg", not a /cygdrive/c/... path. (Otherwise the order of cygwin binaries in the PATH is incorrect). Do not re-use the old repo cloned by the other hg. /Magnus From patrick at reini.net Fri Nov 21 21:34:00 2014 From: patrick at reini.net (Patrick Reinhart) Date: Fri, 21 Nov 2014 22:34:00 +0100 Subject: Creating webrev under Windows/cygwin fails In-Reply-To: <546F7976.7010502@oracle.com> References: <7C44839B-AA03-436B-B1CE-9D1711B4B55E@reini.net> <54675D10.8030501@oracle.com> <546770DC.2040507@oracle.com> <546F7976.7010502@oracle.com> Message-ID: <1CAE7E59-1C0A-43D7-8EA9-F7043BB2F5F0@reini.net> Hi Magnus, > This indicates that you have used another "hg" binary than the one provided by cygwin, e.g. from TortoiseHG. This is not recommended, and will in general fail in weird ways like this. > > I recommend that you install mercurial from cygwin, and run hg clone with that instead. You can verify that your hg is correct by "which hg", it should be "/usr/bin/hg" or "/bin/hg", not a /cygdrive/c/... path. (Otherwise the order of cygwin binaries in the PATH is incorrect). Do not re-use the old repo cloned by the other hg. > > /Magnus Worked perfectly thanks very much. Patrick