diff mercurial/commands.py @ 4276:cb6107f78b92

Merge with crew
author Matt Mackall <mpm@selenic.com>
date Sat, 24 Mar 2007 02:57:27 -0500
parents f38f90a177dc ad33eeeeb50a
children d4f0405fadac
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2255,7 +2255,8 @@ def revert(ui, repo, *pats, **opts):
         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))