[PATCH 1 of 2] bundle: display info about secret changets while no sharable changeset found

alain.leufroy at gmail.com alain.leufroy at gmail.com
Wed Jan 25 12:44:14 CST 2012


# HG changeset patch
# User Alain  Leufroy <alain.leufroyATgmailMYDOTcom>
# Date 1327514716 -3600
# Branch stable
# Node ID 8bf41694f8dcc90a434e7bd701ebf4d58a20a22a
# Parent  c2e6c5ef45555ff98dd12bef335c40a91eccc390
bundle: display info about secret changets while no sharable changeset found

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -994,7 +994,11 @@
                                                 force=opts.get('force'))
         cg = repo.getlocalbundle('bundle', outgoing)
     if not cg:
-        ui.status(_("no changes found\n"))
+        if 'outgoing' in locals() and outgoing.excluded:
+            repo.ui.status(_("no changes found but %i secret changesets\n")
+                           % len(outgoing.excluded))
+        else:
+            ui.status(_("no changes found\n"))
         return 1
 
     bundletype = opts.get('type', 'bzip2').lower()
diff --git a/tests/test-bundle.t b/tests/test-bundle.t
--- a/tests/test-bundle.t
+++ b/tests/test-bundle.t
@@ -39,6 +39,15 @@
   $ cd ..
   $ hg init empty
 
+Bundle and phase
+
+  $ hg -R test phase --force --secret 0
+  $ hg -R test bundle phase.hg empty
+  searching for changes
+  no changes found but 9 secret changesets
+  [1]
+  $ hg -R test phase --draft -r 'head()'
+
 Bundle --all
 
   $ hg -R test bundle --all all.hg


More information about the Mercurial-devel mailing list