Anonymous avatar Anonymous committed 97152ea

fpull -p option for partial forests

Comments (0)

Files changed (3)

             try:
                 tree.getrepo(ui)
             except RepoError:
-                # Need to clone
-                quiet = ui.quiet
-                try:
-                    ui.quiet = True     # Hack to shut up qclone's ui.status()
-                    qclone(ui=ui,
-                           source=srcpath, sroot=source,
-                           dest=destpath, rpath=rpath,
-                           opts=opts)
-                except util.Abort, err:
-                    ui.warn(_("skipped: %s\n") % err)
-                ui.quiet = quiet
+                if opts['partial']:
+                    ui.status(_("repository not previously cloned, skipping\n"))
+                else:
+                    # Need to clone
+                    quiet = ui.quiet
+                    try:
+                        ui.quiet = True # Hack to shut up qclone's ui.status()
+                        qclone(ui=ui,
+                               source=srcpath, sroot=source,
+                               dest=destpath, rpath=rpath,
+                               opts=opts)
+                    except util.Abort, err:
+                        ui.warn(_("skipped: %s\n") % err)
+                    ui.quiet = quiet
                 return
         try:
             commands.pull(ui, tree.getrepo(ui), srcpath, **opts)
              _('hg foutgoing [OPTION]... [DEST]')),
         "^fpull" :
             (pull,
-             [walkhgopts, snapfileopts] + cmd_options(ui, 'pull', remove=('f',)),
+             [('p', 'partial', False,
+               _("do not clone source repositories not previously cloned")),
+              walkhgopts, snapfileopts] + cmd_options(ui, 'pull', remove=('f',)),
              _('hg fpull [OPTION]... [SOURCE]')),
         "^fpush" :
             (push,
 ln -s . circular/a/b
 ln -s .. circular/a/c
 hg fstatus -R circular
+
+echo "# fpull --partial"
+hg init partial
+hg init partial/a
+echo "a" >partial/a/f
+hg init partial/b
+echo "b" >partial/b/f
+hg commit --cwd partial/a -A -m init -d "0 0"
+hg commit --cwd partial/b -A -m init -d "0 0"
+hg fclone partial partial-clone | sed "s@\(/private\)*$HGTMP@HGTMP@g"
+rm -rf partial-clone/b
+hg --cwd partial-clone fpull --partial | sed "s@\(/private\)*$HGTMP@HGTMP@g"
 
 [a/a]
 
+# fpull --partial
+adding f
+adding f
+[.]
+0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+[a]
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+[b]
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+
+[.]
+pulling from HGTMP/test-forest/partial
+no changes found
+
+[a]
+pulling from HGTMP/test-forest/partial/a
+searching for changes
+no changes found
+
+[b]
+repository not previously cloned, skipping
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.