# HG changeset patch # User Eric St-Jean # Date 1174533656 14400 # Node ID ad33eeeeb50a3d07451e25f37988b4e5cc5a3d6c # Parent 1eaa8d90c6890f7556995be719803687cfb19429 Backup symbolic links when reverting diff -r 1eaa8d90c689 -r ad33eeeeb50a mercurial/commands.py --- 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))