mercurial/commands.py
changeset 4524 6c58139f4eaa
parent 4523 b9d311928caf
child 4525 78b6add1f966
equal deleted inserted replaced
4523:b9d311928caf 4524:6c58139f4eaa
  2291     entries = names.items()
  2291     entries = names.items()
  2292     entries.sort()
  2292     entries.sort()
  2293 
  2293 
  2294     for abs, (rel, exact) in entries:
  2294     for abs, (rel, exact) in entries:
  2295         mfentry = mf.get(abs)
  2295         mfentry = mf.get(abs)
       
  2296         target = repo.wjoin(abs)
  2296         def handle(xlist, dobackup):
  2297         def handle(xlist, dobackup):
  2297             xlist[0].append(abs)
  2298             xlist[0].append(abs)
  2298             update[abs] = 1
  2299             update[abs] = 1
  2299             if (dobackup and not opts['no_backup'] and
  2300             if (dobackup and not opts['no_backup'] and
  2300                 (os.path.islink(rel) or os.path.exists(rel))):
  2301                 (os.path.islink(target) or os.path.exists(target))):
  2301                 bakname = "%s.orig" % rel
  2302                 bakname = "%s.orig" % rel
  2302                 ui.note(_('saving current version of %s as %s\n') %
  2303                 ui.note(_('saving current version of %s as %s\n') %
  2303                         (rel, bakname))
  2304                         (rel, bakname))
  2304                 if not opts.get('dry_run'):
  2305                 if not opts.get('dry_run'):
  2305                     util.copyfile(rel, bakname)
  2306                     util.copyfile(target, bakname)
  2306             if ui.verbose or not exact:
  2307             if ui.verbose or not exact:
  2307                 ui.status(xlist[1] % rel)
  2308                 ui.status(xlist[1] % rel)
  2308         for table, hitlist, misslist, backuphit, backupmiss in disptable:
  2309         for table, hitlist, misslist, backuphit, backupmiss in disptable:
  2309             if abs not in table: continue
  2310             if abs not in table: continue
  2310             # file has changed in dirstate
  2311             # file has changed in dirstate