[Bug 4052] New: Cloning with subrepositories over SSH fails

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Fri Oct 4 13:39:20 CDT 2013


http://bz.selenic.com/show_bug.cgi?id=4052

          Priority: normal
            Bug ID: 4052
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Cloning with subrepositories over SSH fails
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: questionably at gmail.com
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.2.2
         Component: Mercurial
           Product: Mercurial

When you clone a repository that contains subrepositories, only the main repo
is actually cloned; the nested repos are not cloned until the repository is
updated. But if the repo is cloned over SSH, this second step fails (since
there is no default path).

For example, consider a main repo "main" with a subrepo "sub". There's no way
to clone both the main repo and subrepo to a remote system in a single step:

local:~/main> hg init # Create main repo
local:~/main> mkdir sub # Create subdir
local:~/main> cd sub
local:~/main/sub> hg init # Create subrepo
local:~/main/sub> echo "example" > example.txt # Create test file
local:~/main/sub> hg add # Add test file
adding example.txt
local:~/main/sub> hg commit -m 'created subrepo' # Commit subrepo
local:~/main/sub> cd ..
local:~/main> echo "sub = sub" > .hgsub # Mark as subrepo
local:~/main> hg add # Add .hgsub
adding .hgsub
local:~/main> hg commit -m 'added subrepo' # Commit main repo
local:~/main> hg clone . ssh://remote # Clone main rempo
remote:~/main> hg update # Try to update -- it fails
abort: default path for subrepository sub not found

Currently, the only solution is to first clone the main repo and then manually
clone each of the subrepos, which is a huge nuisance -- it defeats the purpose
of using subrepos in the first place! (Finally, note that this problem doesn't
occur if you clone from remote to local, since it updates automatically. But
there doesn't seem to be a way to force an update on the remote machine
following a clone.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list