Patchwork [4,of,4] bundle: warn for --base with --all

login
register
mail settings
Submitter timeless@mozdev.org
Date Dec. 17, 2015, 3:13 p.m.
Message ID <1e3ae3c52567ec363400.1450365218@waste.org>
Download mbox | patch
Permalink /patch/12104/
State Accepted
Headers show

Comments

timeless@mozdev.org - Dec. 17, 2015, 3:13 p.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1450364725 0
#      Thu Dec 17 15:05:25 2015 +0000
# Node ID 1e3ae3c52567ec363400d31044ba8c6bc097c7d1
# Parent  52f06746feaaafa311aa4dca1495aba5ea1406a2
bundle: warn for --base with --all
Augie Fackler - Dec. 18, 2015, 4:31 p.m.
On Thu, Dec 17, 2015 at 09:13:38AM -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1450364725 0
> #      Thu Dec 17 15:05:25 2015 +0000
> # Node ID 1e3ae3c52567ec363400d31044ba8c6bc097c7d1
> # Parent  52f06746feaaafa311aa4dca1495aba5ea1406a2
> bundle: warn for --base with --all

queued these, thanks

>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -1347,6 +1347,8 @@
>          if dest:
>              raise error.Abort(_("--all is incompatible with specifying "
>                                  "a destination"))
> +        if opts.get('base'):
> +            ui.warn(_("ignoring --base because --all was specified\n"))
>          base = ['null']
>      else:
>          base = scmutil.revrange(repo, opts.get('base'))
> diff --git a/tests/test-bundle-r.t b/tests/test-bundle-r.t
> --- a/tests/test-bundle-r.t
> +++ b/tests/test-bundle-r.t
> @@ -174,6 +174,9 @@
>    4 changesets found
>    $ hg -R test bundle --base 2 test-bundle-all.hg
>    6 changesets found
> +  $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
> +  ignoring --base because --all was specified
> +  9 changesets found
>    $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
>    1 changesets found
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1347,6 +1347,8 @@ 
         if dest:
             raise error.Abort(_("--all is incompatible with specifying "
                                 "a destination"))
+        if opts.get('base'):
+            ui.warn(_("ignoring --base because --all was specified\n"))
         base = ['null']
     else:
         base = scmutil.revrange(repo, opts.get('base'))
diff --git a/tests/test-bundle-r.t b/tests/test-bundle-r.t
--- a/tests/test-bundle-r.t
+++ b/tests/test-bundle-r.t
@@ -174,6 +174,9 @@ 
   4 changesets found
   $ hg -R test bundle --base 2 test-bundle-all.hg
   6 changesets found
+  $ hg -R test bundle --base 2 --all test-bundle-all-2.hg
+  ignoring --base because --all was specified
+  9 changesets found
   $ hg -R test bundle --base 3 -r tip test-bundle-should-fail.hg
   1 changesets found