[PATCH] rename --after: do not unlink source file (issue 910)

Adrian Buehlmann adrian at cadifra.com
Wed Apr 23 17:50:00 CDT 2008


Ping: as sent on 2008-04-19

# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1208594550 -7200
# Node ID 68eea0baca055d367b14b7b9a56ecc0aeade0ee7
# Parent  090f2145df7db6a638c53cee74a7fbd2fa6b9619
rename --after: do not unlink source file (issue 910)

"rename --after a.txt A.txt" on case mangling systems (e.g. Windows)
erroneously deleted A.txt (even if modified).

Code change provided by Alexis S. L. Carvalho
http://selenic.com/pipermail/mercurial-devel/2008-April/005931.html

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -395,7 +395,7 @@
                 repo.copy(origsrc, abstarget)

         if rename and not dryrun:
-            repo.remove([abssrc], True)
+            repo.remove([abssrc], not after)

     # pat: ossep
     # dest ossep



More information about the Mercurial-devel mailing list