Patchwork [19,of,19] localrepo: use _matchstatus instead of duplicating logic

login
register
mail settings
Submitter Sean Farley
Date May 15, 2014, 9:16 p.m.
Message ID <d75f16aa949583b5df79.1400188597@laptop.local>
Download mbox | patch
Permalink /patch/4778/
State Changes Requested
Headers show

Comments

Sean Farley - May 15, 2014, 9:16 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1398286466 18000
#      Wed Apr 23 15:54:26 2014 -0500
# Node ID d75f16aa949583b5df790da29e461cbbc75904b0
# Parent  a7bf5d5ab5a5671c5362389d52a2e3dd438be49c
localrepo: use _matchstatus instead of duplicating logic
Pierre-Yves David - May 18, 2014, 4:09 a.m.
On 05/15/2014 02:16 PM, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1398286466 18000
> #      Wed Apr 23 15:54:26 2014 -0500
> # Node ID d75f16aa949583b5df790da29e461cbbc75904b0
> # Parent  a7bf5d5ab5a5671c5362389d52a2e3dd438be49c
> localrepo: use _matchstatus instead of duplicating logic

An updated version of this series have been pushed to the clowncopter.

I'm looking forward for the next series.

(queued)

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1528,27 +1528,19 @@  class localrepository(object):
             and isinstance(ctx2, context.changectx)):
             reversed = True
             ctx1, ctx2 = ctx2, ctx1
 
         working = ctx2.rev() is None
-        parentworking = working and ctx1 == self['.']
-        match = match or matchmod.always(self.root, self.getcwd())
         listignored, listclean, listunknown = ignored, clean, unknown
 
         # load earliest manifest first for caching reasons
         if not working and ctx2.rev() < ctx1.rev():
             ctx2.manifest()
 
-        if not parentworking:
-            def bad(f, msg):
-                # 'f' may be a directory pattern from 'match.files()',
-                # so 'f not in ctx1' is not enough
-                if f not in ctx1 and f not in ctx1.dirs():
-                    self.ui.warn('%s: %s\n' % (self.dirstate.pathto(f), msg))
-            match.bad = bad
-
         r = [[], [], [], [], [], [], []]
+        match = ctx2._matchstatus(ctx1, r, match, listignored, listclean,
+                                  listunknown)
         r = ctx2._prestatus(ctx1, r, match, listignored, listclean, listunknown)
         r = ctx2._generatestatus(ctx1, r, match, listignored, listclean,
                                  listunknown)
         r = ctx2._poststatus(ctx1, r, match, listignored, listclean,
                              listunknown)