[PATCH] Fix incorrect error code for `hg remove --after dirname`

Sergey sergemp at mail.ru
Sun Oct 21 14:09:32 CDT 2012


# HG changeset patch
# User sergey at localhost.localdomain
# Date 1350846395 -10800
# Node ID e2bc48c28ded515f2d22c00fe58152e1256a1730
# Parent  d51364b318eab1871af13f30be099799c04a43d1
remove: return correct exit code when deleting directory with --after

`hg remove --after dirname` complains about untracked files
and returns non-zero error code. This breaks tools using hg,
e.g. hgsvn.

Changeset 14604:b1a534335548 fixed the message, but not exit code.

diff -r d51364b318ea -r e2bc48c28ded mercurial/commands.py
--- a/mercurial/commands.py	Thu Jul 26 21:29:39 2012 +0200
+++ b/mercurial/commands.py	Sun Oct 21 22:06:35 2012 +0300
@@ -4846,7 +4846,7 @@
         if f not in repo.dirstate and not os.path.isdir(m.rel(f)):
             if os.path.exists(m.rel(f)):
                 ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))
-            ret = 1
+                ret = 1
 
     if force:
         list = modified + deleted + clean + added


More information about the Mercurial-devel mailing list