[PATCH] addremove: print relative paths when called with -I/-X

Matt Harbison matt_harbison at yahoo.com
Wed Dec 3 23:10:52 CST 2014


On Tue, 02 Dec 2014 07:02:29 +0000, Martin von Zweigbergk wrote:

> mpm, I see you have a lot of patches in flight. If you agree with this
> patch, you may want to pick it before the other Matt's patches, and instead
> make the poor guy send a V3.
> 
> Matt, I didn't look past the first 6 or so patches. Did the anyfiles()
> method end up being used anywhere else, or would this patch remove the need
> for it completely?
> 
> On Mon Dec 01 2014 at 9:56:26 PM Martin von Zweigbergk <
> martinvonz at google.com> wrote:
> 
>> # HG changeset patch
>> # User Martin von Zweigbergk <martinvonz at google.com>
>> # Date 1417499312 28800
>> #      Mon Dec 01 21:48:32 2014 -0800
>> # Node ID 0ec94796e8c2d5c142976edb49c911a92341b109
>> # Parent  19ebd2f88fc77282efe724b30de8750f79771e8f
>> addremove: print relative paths when called with -I/-X
>>

So I rebased my V2 series on top of this, and it changed the tests on me.
Specifically the test I tried was basically:

	$ hg init repo
	$ mkdir repo/dir
	<create various files>
	$ cd repo/dir
	$ hg addremove ..

This prints out absolute files instead of relative, unlike before.  I put
some prints in match, and what happens (in my real test) is '..' gets
normalized to:

	[('relpath', '.hglf')]"

match._anypats() doesn't consider 'relpath' to be a pattern, so it returns
None, and match.anypats() therefore returns False.  Maybe it should be OR'd
with the fact that the pattern parameter is not empty?  I didn't run the
tests to see if that breaks anything.  (I'm not sure why it didn't also
list the directory I was in as a relpath too.)

We should probably figure this out and get it squared away before applying
this change to status, annotate et al, and before I resubmit my series with
bad tests.

--Matt



More information about the Mercurial-devel mailing list