[PATCH] subrepo: fix default implementation of forget() (issue3404)

Patrick Mezard patrick at mezard.eu
Fri Apr 27 04:07:58 CDT 2012


# HG changeset patch
# User Patrick Mezard <patrick at mezard.eu>
# Date 1335517336 -7200
# Branch stable
# Node ID 4be2a1b8910aaa3b1415e1152cd657d64d51bb1c
# Parent  4bce649a2b0f49653b2caad0c9294a4303392609
subrepo: fix default implementation of forget() (issue3404)

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -366,7 +366,7 @@
         pass
 
     def forget(self, ui, match, prefix):
-        return []
+        return ([], [])
 
     def revert(self, ui, substate, *pats, **opts):
         ui.warn('%s: reverting %s subrepos is unsupported\n' \
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
@@ -507,3 +507,8 @@
   da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
   $ cd ..
 
+Test forgetting files, not implemented in git subrepo, used to
+traceback
+  $ hg forget 'notafile*'
+  notafile*: No such file or directory
+  [1]
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
@@ -548,3 +548,10 @@
   archiving (s): 2/2 files (100.00%)
   archiving (recreated): 0/1 files (0.00%)
   archiving (recreated): 1/1 files (100.00%)
+
+Test forgetting files, not implemented in svn subrepo, used to
+traceback
+
+  $ hg forget 'notafile*'
+  notafile*: No such file or directory
+  [1]


More information about the Mercurial-devel mailing list