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

Matt Mackall mpm at selenic.com
Sun Oct 21 16:50:40 CDT 2012


On Sun, 2012-10-21 at 22:09 +0300, Sergey wrote:
> # 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.

'hg help rm' going back as far as 1.6 (Jun 2010) says:

    Returns 0 on success, 1 if any warnings encountered.

And this is clearly a warning:

                 ui.warn(_('not removing %s: file is untracked\n') % m.rel(f))

So the current behavior is correct as documented. Changing it to fix
hgsvn risks breaking other tools and scripts that _reasonably depend on
long-standing documented behavior_. This is not the sort of risk we like
to take.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list