largefiles: preserve the exit status of the forget command stable
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 05 Sep 2012 22:42:23 -0400
branchstable
changeset 17579 cbacb5a813dd
parent 17578 40c988f108d0
child 17582 495d3c671a8b
largefiles: preserve the exit status of the forget command This maintains the exit codes documented in commands.py.
hgext/largefiles/overrides.py
tests/test-largefiles.t
--- a/hgext/largefiles/overrides.py	Wed Sep 05 22:31:03 2012 -0400
+++ b/hgext/largefiles/overrides.py	Wed Sep 05 22:42:23 2012 -0400
@@ -894,7 +894,7 @@
 
 def overrideforget(orig, ui, repo, *pats, **opts):
     installnormalfilesmatchfn(repo[None].manifest())
-    orig(ui, repo, *pats, **opts)
+    result = orig(ui, repo, *pats, **opts)
     restorematchfn()
     m = scmutil.match(repo[None], pats, opts)
 
@@ -911,6 +911,7 @@
                 os.path.isdir(m.rel(lfutil.standin(f))):
             ui.warn(_('not removing %s: file is already untracked\n')
                     % m.rel(f))
+            result = 1
 
     for f in forget:
         if ui.verbose or not m.exact(f):
@@ -932,6 +933,8 @@
     finally:
         wlock.release()
 
+    return result
+
 def getoutgoinglfiles(ui, repo, dest=None, **opts):
     dest = ui.expandpath(dest or 'default-push', dest or 'default')
     dest, branches = hg.parseurl(dest, opts.get('branch'))
--- a/tests/test-largefiles.t	Wed Sep 05 22:31:03 2012 -0400
+++ b/tests/test-largefiles.t	Wed Sep 05 22:42:23 2012 -0400
@@ -116,6 +116,9 @@
   $ hg remove large1-test
   not removing large1-test: file is untracked
   [1]
+  $ hg forget large1-test
+  not removing large1-test: file is already untracked
+  [1]
   $ rm large1-test
 
 Copy both largefiles and normal files (testing that status output is correct).