Patchwork [5,of,5] revert: drop now useless conditional in the backup check

mail settings
Submitter Pierre-Yves David
Date Sept. 4, 2014, 6:33 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/5702/
State Superseded
Headers show


Pierre-Yves David - Sept. 4, 2014, 6:33 p.m.
# HG changeset patch
# User Pierre-Yves David <>
# Date 1409356262 -7200
#      Sat Aug 30 01:51:02 2014 +0200
# Node ID 99a0a2ac656204180970ebd6c2deebcff641b54d
# Parent  177a07088af45a1b94773f56d985423fd402c3fa
revert: drop now useless conditional in the backup check

Now that we removed the (hopeless attempt) attempt to backup file we knew to be
missing in the target changesets, we can stop checking if the file exists in
the target changeset.


diff --git a/mercurial/ b/mercurial/
--- a/mercurial/
+++ b/mercurial/
@@ -2549,12 +2549,12 @@  def revert(ui, repo, ctx, parents, *pats
             for table, (xlist, msg), dobackup in disptable:
                 if abs not in table:
                 if xlist is not None:
-                    if (dobackup and os.path.lexists(target) and
-                        abs in ctx and repo[None][abs].cmp(ctx[abs])):
+                    if (dobackup and os.path.lexists(target)
+                        and repo[None][abs].cmp(ctx[abs])):
                         bakname = "%s.orig" % rel
                         ui.note(_('saving current version of %s as %s\n') %
                                 (rel, bakname))
                         if not opts.get('dry_run'):
                             util.rename(target, bakname)