changeset 4272:ad33eeeeb50a

Backup symbolic links when reverting
author Eric St-Jean <esj@wwd.ca>
date Wed, 21 Mar 2007 23:20:56 -0400
parents 1eaa8d90c689
children 4a1504264261
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Wed Mar 21 23:20:56 2007 -0400
+++ b/mercurial/commands.py	Wed Mar 21 23:20:56 2007 -0400
@@ -2256,7 +2256,8 @@
         def handle(xlist, dobackup):
             xlist[0].append(abs)
             update[abs] = 1
-            if dobackup and not opts['no_backup'] and os.path.exists(rel):
+            if (dobackup and not opts['no_backup'] and
+                (os.path.islink(rel) or os.path.exists(rel))):
                 bakname = "%s.orig" % rel
                 ui.note(_('saving current version of %s as %s\n') %
                         (rel, bakname))