Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 22398:402e5fba6509
revert: drop `lexist` check in the backup logic
We are no longer trying to backup files that do not exist on disk. This check
can be safely dropped.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Sat, 30 Aug 2014 02:10:29 +0200 |
parents | 1db04829bdc1 |
children | 6f63c47cbb86 |
comparison
equal
deleted
inserted
replaced
22397:1db04829bdc1 | 22398:402e5fba6509 |
---|---|
2574 for table, (xlist, msg), dobackup in disptable: | 2574 for table, (xlist, msg), dobackup in disptable: |
2575 if abs not in table: | 2575 if abs not in table: |
2576 continue | 2576 continue |
2577 if xlist is not None: | 2577 if xlist is not None: |
2578 xlist.append(abs) | 2578 xlist.append(abs) |
2579 if (dobackup and os.path.lexists(target) | 2579 if (dobackup and wctx[abs].cmp(ctx[abs])): |
2580 and wctx[abs].cmp(ctx[abs])): | |
2581 bakname = "%s.orig" % rel | 2580 bakname = "%s.orig" % rel |
2582 ui.note(_('saving current version of %s as %s\n') % | 2581 ui.note(_('saving current version of %s as %s\n') % |
2583 (rel, bakname)) | 2582 (rel, bakname)) |
2584 if not opts.get('dry_run'): | 2583 if not opts.get('dry_run'): |
2585 util.rename(target, bakname) | 2584 util.rename(target, bakname) |