Patchwork [5,of,6] revert: drop special case handling for file unknown in parent

login
register
mail settings
Submitter Pierre-Yves David
Date Aug. 14, 2014, 9:35 p.m.
Message ID <cb437f41f3d1523b2a56.1408052159@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5400/
State Accepted
Headers show

Comments

Pierre-Yves David - Aug. 14, 2014, 9:35 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1403625436 -3600
#      Tue Jun 24 16:57:16 2014 +0100
# Node ID cb437f41f3d1523b2a56791a3694434d037c1fff
# Parent  cf3fa01f51d15a6eb03957a74502d44e3f7575d2
revert: drop special case handling for file unknown in parent

We had a special case for file not caught by any categories. It was aimed at file
missing in wc and wc's parent but existing in the target revision. This is now
properly handled using status information.

Patch

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2486,13 +2486,11 @@  def revert(ui, repo, ctx, parents, *pats
             else:
                 # Not touched in current dirstate.
 
                 # file is unknown in parent, restore older version or ignore.
                 if abs not in repo.dirstate:
-                    if mfentry:
-                        handle(actions['add'], True)
-                    elif exact:
+                    if exact:
                         ui.warn(_('file not managed: %s\n') % rel)
                     continue
 
                 # parent is target, no changes mean no changes
                 if node == parent: