Patchwork [STABLE] subrepo: don't abort in add when non-hg subrepos are present (issue4513)

login
register
mail settings
Submitter Matt Harbison
Date Jan. 28, 2015, 2:20 a.m.
Message ID <8f02682ff3b03a86abc0.1422411659@Envy>
Download mbox | patch
Permalink /patch/7567/
State Accepted
Commit 8f02682ff3b03a86abc09ff5b0397842ea70ba07
Headers show

Comments

Matt Harbison - Jan. 28, 2015, 2:20 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1422410263 18000
#      Tue Jan 27 20:57:43 2015 -0500
# Branch stable
# Node ID 8f02682ff3b03a86abc09ff5b0397842ea70ba07
# Parent  1f3b94e8dc4012051482f54b51a07ff66e15dee2
subrepo: don't abort in add when non-hg subrepos are present (issue4513)

This change should have been part of 9994f45ba714.
Augie Fackler - Jan. 28, 2015, 4:25 p.m.
On Tue, Jan 27, 2015 at 09:20:59PM -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1422410263 18000
> #      Tue Jan 27 20:57:43 2015 -0500
> # Branch stable
> # Node ID 8f02682ff3b03a86abc09ff5b0397842ea70ba07
> # Parent  1f3b94e8dc4012051482f54b51a07ff66e15dee2
> subrepo: don't abort in add when non-hg subrepos are present (issue4513)

Queued this, thanks a bunch for the fixup.

>
> This change should have been part of 9994f45ba714.
>
> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
> --- a/mercurial/subrepo.py
> +++ b/mercurial/subrepo.py
> @@ -435,7 +435,7 @@
>          """
>          raise NotImplementedError
>
> -    def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly):
> +    def add(self, ui, match, prefix, explicitonly, **opts):
>          return []
>
>      def addremove(self, matcher, prefix, opts, dry_run, similarity):
> diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
> --- a/tests/test-subrepo-git.t
> +++ b/tests/test-subrepo-git.t
> @@ -133,6 +133,7 @@
>    $ echo f > f
>    $ hg status --subrepos
>    ? s/f
> +  $ hg add .
>    $ git add f
>    $ cd ..
>
> diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t
> --- a/tests/test-subrepo-svn.t
> +++ b/tests/test-subrepo-svn.t
> @@ -439,8 +439,9 @@
>    $ hg add .hgsub
>    $ hg ci -m addsub
>    $ echo a > a
> -  $ hg ci -Am adda
> +  $ hg add .
>    adding a
> +  $ hg ci -m adda
>    $ hg up 0
>    0 files updated, 0 files merged, 1 files removed, 0 files unresolved
>    $ svn up -qr6 s
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -435,7 +435,7 @@ 
         """
         raise NotImplementedError
 
-    def add(self, ui, match, dryrun, listsubrepos, prefix, explicitonly):
+    def add(self, ui, match, prefix, explicitonly, **opts):
         return []
 
     def addremove(self, matcher, prefix, opts, dry_run, similarity):
diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -133,6 +133,7 @@ 
   $ echo f > f
   $ hg status --subrepos
   ? s/f
+  $ hg add .
   $ git add f
   $ cd ..
 
diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t
--- a/tests/test-subrepo-svn.t
+++ b/tests/test-subrepo-svn.t
@@ -439,8 +439,9 @@ 
   $ hg add .hgsub
   $ hg ci -m addsub
   $ echo a > a
-  $ hg ci -Am adda
+  $ hg add .
   adding a
+  $ hg ci -m adda
   $ hg up 0
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
   $ svn up -qr6 s