mercurial/commands.py
changeset 4572 339b8aeee8c5
parent 4570 6a8e1dd18ba2
child 4574 b841dc886ba1
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2261,8 +2261,7 @@ 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.islink(target) or os.path.exists(target))):
+            if dobackup and not opts['no_backup'] and util.lexists(target):
                 bakname = "%s.orig" % rel
                 ui.note(_('saving current version of %s as %s\n') %
                         (rel, bakname))