Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 4272:ad33eeeeb50a
Backup symbolic links when reverting
author | Eric St-Jean <esj@wwd.ca> |
---|---|
date | Wed, 21 Mar 2007 23:20:56 -0400 |
parents | bda63383d529 |
children | cb6107f78b92 |
comparison
equal
deleted
inserted
replaced
4271:1eaa8d90c689 | 4272:ad33eeeeb50a |
---|---|
2254 for abs, (rel, exact) in entries: | 2254 for abs, (rel, exact) in entries: |
2255 mfentry = mf.get(abs) | 2255 mfentry = mf.get(abs) |
2256 def handle(xlist, dobackup): | 2256 def handle(xlist, dobackup): |
2257 xlist[0].append(abs) | 2257 xlist[0].append(abs) |
2258 update[abs] = 1 | 2258 update[abs] = 1 |
2259 if dobackup and not opts['no_backup'] and os.path.exists(rel): | 2259 if (dobackup and not opts['no_backup'] and |
2260 (os.path.islink(rel) or os.path.exists(rel))): | |
2260 bakname = "%s.orig" % rel | 2261 bakname = "%s.orig" % rel |
2261 ui.note(_('saving current version of %s as %s\n') % | 2262 ui.note(_('saving current version of %s as %s\n') % |
2262 (rel, bakname)) | 2263 (rel, bakname)) |
2263 if not opts.get('dry_run'): | 2264 if not opts.get('dry_run'): |
2264 util.copyfile(rel, bakname) | 2265 util.copyfile(rel, bakname) |