Patchwork [1,of,4,STABLE] test-subrepo: demonstrate problems with subrepo sharing and absolute paths

login
register
mail settings
Submitter Matt Harbison
Date March 4, 2018, 4:03 a.m.
Message ID <eca5075fdd5ec15e1a49.1520136205@Envy>
Download mbox | patch
Permalink /patch/28902/
State Accepted
Headers show

Comments

Matt Harbison - March 4, 2018, 4:03 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1519795767 18000
#      Wed Feb 28 00:29:27 2018 -0500
# Branch stable
# Node ID eca5075fdd5ec15e1a4917c0cadeb23e00feb2fe
# Parent  0a7c59a4c8352b9277a9676708cf6a30d3e2e306
test-subrepo: demonstrate problems with subrepo sharing and absolute paths

This affects remote paths in .hgsub, as well as clone pooling from a remote
source.

For reasons unknown, there are stability issues with the relative-path.t tests.
If run as a single test, it is stable.  If run with --loop, or with -jX for X>1,
the hash of the parent repo changes.  I'm seeing this on both Windows and Fedora
26.  I added an `hg log --debug`, and the manifest hash changes, but I have no
idea why.
Yuya Nishihara - March 4, 2018, 1:20 p.m.
On Sat, 03 Mar 2018 23:03:25 -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1519795767 18000
> #      Wed Feb 28 00:29:27 2018 -0500
> # Branch stable
> # Node ID eca5075fdd5ec15e1a4917c0cadeb23e00feb2fe
> # Parent  0a7c59a4c8352b9277a9676708cf6a30d3e2e306
> test-subrepo: demonstrate problems with subrepo sharing and absolute paths

Queued for stable, many thanks.
Matt Harbison - March 4, 2018, 10:15 p.m.
On Sun, 04 Mar 2018 08:20:07 -0500, Yuya Nishihara <yuya@tcha.org> wrote:

> On Sat, 03 Mar 2018 23:03:25 -0500, Matt Harbison wrote:
>> # HG changeset patch
>> # User Matt Harbison <matt_harbison@yahoo.com>
>> # Date 1519795767 18000
>> #      Wed Feb 28 00:29:27 2018 -0500
>> # Branch stable
>> # Node ID eca5075fdd5ec15e1a4917c0cadeb23e00feb2fe
>> # Parent  0a7c59a4c8352b9277a9676708cf6a30d3e2e306
>> test-subrepo: demonstrate problems with subrepo sharing and absolute  
>> paths
>
> Queued for stable, many thanks.

Any idea what the easiest way to snoop on the manifest hash generation is,  
to see what is being fed in, and hopefully why the test is unstable?  I  
have no idea where that's done.
Yuya Nishihara - March 6, 2018, 12:30 p.m.
On Sun, 04 Mar 2018 17:15:30 -0500, Matt Harbison wrote:
> On Sun, 04 Mar 2018 08:20:07 -0500, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> > On Sat, 03 Mar 2018 23:03:25 -0500, Matt Harbison wrote:
> >> # HG changeset patch
> >> # User Matt Harbison <matt_harbison@yahoo.com>
> >> # Date 1519795767 18000
> >> #      Wed Feb 28 00:29:27 2018 -0500
> >> # Branch stable
> >> # Node ID eca5075fdd5ec15e1a4917c0cadeb23e00feb2fe
> >> # Parent  0a7c59a4c8352b9277a9676708cf6a30d3e2e306
> >> test-subrepo: demonstrate problems with subrepo sharing and absolute  
> >> paths
> >
> > Queued for stable, many thanks.
> 
> Any idea what the easiest way to snoop on the manifest hash generation is,  
> to see what is being fed in, and hopefully why the test is unstable?  I  
> have no idea where that's done.

Appears that the test depends on $HGPORT value.
Matt Harbison - March 6, 2018, 1:03 p.m.
> On Mar 6, 2018, at 7:30 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> 
>> On Sun, 04 Mar 2018 17:15:30 -0500, Matt Harbison wrote:
>>> On Sun, 04 Mar 2018 08:20:07 -0500, Yuya Nishihara <yuya@tcha.org> wrote:
>>> 
>>>> On Sat, 03 Mar 2018 23:03:25 -0500, Matt Harbison wrote:
>>>> # HG changeset patch
>>>> # User Matt Harbison <matt_harbison@yahoo.com>
>>>> # Date 1519795767 18000
>>>> #      Wed Feb 28 00:29:27 2018 -0500
>>>> # Branch stable
>>>> # Node ID eca5075fdd5ec15e1a4917c0cadeb23e00feb2fe
>>>> # Parent  0a7c59a4c8352b9277a9676708cf6a30d3e2e306
>>>> test-subrepo: demonstrate problems with subrepo sharing and absolute  
>>>> paths
>>> 
>>> Queued for stable, many thanks.
>> 
>> Any idea what the easiest way to snoop on the manifest hash generation is,  
>> to see what is being fed in, and hopefully why the test is unstable?  I  
>> have no idea where that's done.
> 
> Appears that the test depends on $HGPORT value.

Oh, yeah.  Thanks.

Patch

diff --git a/tests/test-subrepo-recursion.t b/tests/test-subrepo-recursion.t
--- a/tests/test-subrepo-recursion.t
+++ b/tests/test-subrepo-recursion.t
@@ -292,6 +292,25 @@ 
   z2
   z3
 
+BUG: The remote subrepo should be cloned to the local pool, and then shared
+from there.
+
+  $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
+  >    clone http://localhost:$HGPORT shared
+  (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 3 changesets with 5 changes to 3 files
+  new changesets 23376cbba0d8:1326fa26d0c0
+  searching for changes
+  no changes found
+  updating working directory
+  sharing subrepo foo from http://localhost:$HGPORT/foo
+  abort: can only share local repositories (in subrepository "foo")
+  [255]
+
   $ cat access.log
   * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
   * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
@@ -302,6 +321,14 @@ 
   * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
   * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob)
   * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
+  $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
 
   $ killdaemons.py
   $ rm hg1.pid error.log access.log
@@ -485,6 +512,22 @@ 
   commit: (clean)
   update: 4 new changesets (update)
 
+Sharing a local repo without the locally referenced subrepo (i.e. it was never
+updated from null), fails the same as a clone operation.
+
+  $ hg --config progress.disable=True clone -U ../empty ../empty2
+
+  $ hg --config extensions.share= --config progress.disable=True \
+  >    share ../empty2 ../empty_share
+  updating working directory
+  abort: repository $TESTTMP/empty2/foo not found!
+  [255]
+
+  $ hg --config progress.disable=True clone ../empty2 ../empty_clone
+  updating to branch default
+  abort: repository $TESTTMP/empty2/foo not found!
+  [255]
+
 Disable progress extension and cleanup:
 
   $ mv $HGRCPATH.no-progress $HGRCPATH
diff --git a/tests/test-subrepo-relative-path.t b/tests/test-subrepo-relative-path.t
--- a/tests/test-subrepo-relative-path.t
+++ b/tests/test-subrepo-relative-path.t
@@ -72,6 +72,59 @@ 
    source   ../sub
    revision 863c1745b441bd97a8c4a096e87793073f4fb215
 
+Test sharing with a remote URL reference
+
+  $ hg init absolute_subrepo
+  $ cd absolute_subrepo
+  $ echo foo > foo.txt
+  $ hg ci -Am 'initial commit'
+  adding foo.txt
+  $ echo "sub = http://localhost:$HGPORT/sub" > .hgsub
+  $ hg ci -Am 'add absolute subrepo'
+  adding .hgsub
+  $ cd ..
+
+BUG: Remote subrepos cannot be shared, and pooled repos don't have their
+relative subrepos in the relative location stated in .hgsub.
+
+  $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
+  >    clone absolute_subrepo cloned_from_abs
+  (sharing from new pooled repository 8d6a2f1e993b34b6557de0042cfe825ae12a8dae)
+  requesting all changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 2 changesets with 3 changes to 3 files
+  new changesets 8d6a2f1e993b:c6d0e6ebd1c9
+  searching for changes
+  no changes found
+  updating working directory
+  sharing subrepo sub from http://localhost:$HGPORT/sub
+  abort: can only share local repositories (in subrepository "sub")
+  [255]
+
+  $ hg --config extensions.share= share absolute_subrepo shared_from_abs
+  updating working directory
+  sharing subrepo sub from http://localhost:$HGPORT/sub
+  abort: can only share local repositories (in subrepository "sub")
+  [255]
+
+  $ hg --config extensions.share= share -U absolute_subrepo shared_from_abs2
+  $ hg -R shared_from_abs2 update -r tip
+  sharing subrepo sub from http://localhost:$HGPORT/sub
+  abort: can only share local repositories (in subrepository "sub")
+  [255]
+
+BUG: A repo without its subrepo available locally should be sharable if the
+subrepo is referenced by absolute path.
+
+  $ hg clone -U absolute_subrepo cloned_null_from_abs
+  $ hg --config extensions.share= share cloned_null_from_abs shared_from_null_abs
+  updating working directory
+  sharing subrepo sub from http://localhost:$HGPORT/sub
+  abort: can only share local repositories (in subrepository "sub")
+  [255]
+
   $ killdaemons.py
 
 subrepo paths with ssh urls