Patchwork copies: fix detection of divergent directory renames

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 17, 2016, 7:21 p.m.
Message ID <569BE9AE.8010201@ens-lyon.org>
Download mbox | patch
Permalink /patch/12816/
State Accepted
Commit 602add6ad9e519598e72c873f7a6581dbbb9e390
Delegated to: Pierre-Yves David
Headers show

Comments

Pierre-Yves David - Jan. 17, 2016, 7:21 p.m.
On 01/14/2016 12:18 PM, Matt Mackall wrote:
> # HG changeset patch
> # User Matt Mackall <mpm@selenic.com>
> # Date 1452701405 21600
> #      Wed Jan 13 10:10:05 2016 -0600
> # Node ID bd0fd63e29dc589709fe5232b32bef3533445754
> # Parent  0ac5b7ee5dc20b9d25effe654c3f73335db19e5b
> copies: fix detection of divergent directory renames

Pushed to the clowncopter with minor adjustements.

[…]

> +Try the merge in the other direction
> +
> +  $ hg up -C 1
> +  4 files updated, 0 files merged, 2 files removed, 0 files unresolved
> +  $ hg merge
> +  2 files updated, 0 files merged, 2 files removed, 0 files unresolved
> +  (branch merge, don't forget to commit)
> +  $ hg st
> +  M s/s
> +  M t/t
> +  R a/s
> +  R a/t

note: The status (with --copies) is missing the rename here.
I ssume this is because status if not looking for copies for 'M' files. 
The copy information is properly stored inside the file revision.

Diff of the change I made:


    R a/t
Matt Mackall - Jan. 17, 2016, 7:34 p.m.
On Sun, 2016-01-17 at 11:21 -0800, Pierre-Yves David wrote:
> 
> On 01/14/2016 12:18 PM, Matt Mackall wrote:
> > # HG changeset patch
> > # User Matt Mackall <mpm@selenic.com>

> (The status (with --copies) is missing the rename here.  I ssume this is

Be careful with "I" (and spelling) when you're not the committer of record.
-- 
Mathematics is the supreme nostalgia of our time.
Pierre-Yves David - Jan. 17, 2016, 7:38 p.m.
On 01/17/2016 11:34 AM, Matt Mackall wrote:
> On Sun, 2016-01-17 at 11:21 -0800, Pierre-Yves David wrote:
>>
>> On 01/14/2016 12:18 PM, Matt Mackall wrote:
>>> # HG changeset patch
>>> # User Matt Mackall <mpm@selenic.com>
>
>> (The status (with --copies) is missing the rename here.  I ssume this is
>
> Be careful with "I" (and spelling) when you're not the committer of record.

Good point. I originally wrote that for the email and realised It could 
be move in the test.

Do you want me to fix it one the clowncopter or will you fix it in flight?
Matt Mackall - Jan. 17, 2016, 7:42 p.m.
On Sun, 2016-01-17 at 11:38 -0800, Pierre-Yves David wrote:
> 
> On 01/17/2016 11:34 AM, Matt Mackall wrote:
> > On Sun, 2016-01-17 at 11:21 -0800, Pierre-Yves David wrote:
> > > 
> > > On 01/14/2016 12:18 PM, Matt Mackall wrote:
> > > > # HG changeset patch
> > > > # User Matt Mackall <mpm@selenic.com>
> > 
> > > (The status (with --copies) is missing the rename here.  I ssume this is
> > 
> > Be careful with "I" (and spelling) when you're not the committer of record.
> 
> Good point. I originally wrote that for the email and realised It could 
> be move in the test.
> 
> Do you want me to fix it one the clowncopter or will you fix it in flight?

I'll take care of it.

Patch

diff --git a/tests/test-rename-dir-merge.t b/tests/test-rename-dir-merge.t
--- a/tests/test-rename-dir-merge.t
+++ b/tests/test-rename-dir-merge.t
@@ -259,27 +259,38 @@  Do moves on a branch
    $ mkdir t
    $ hg mv a/s s
    $ hg mv a/t t
    $ hg ci -Am2
    created new head
+  $ hg st --copies --change .
+  A s/s
+    a/s
+  A t/t
+    a/t
+  R a/s
+  R a/t

  Merge shouldn't move s2, t2

    $ hg merge
    2 files updated, 0 files merged, 0 files removed, 0 files unresolved
    (branch merge, don't forget to commit)
-  $ hg st
+  $ hg st --copies
    M a/s2
    M a/t2

  Try the merge in the other direction

+(The status (with --copies) is missing the rename here.  I ssume this is
+because status if not looking for copies for 'M' files. The copy 
information is
+properly stored inside the file revision.)
+
    $ hg up -C 1
    4 files updated, 0 files merged, 2 files removed, 0 files unresolved
    $ hg merge
    2 files updated, 0 files merged, 2 files removed, 0 files unresolved
    (branch merge, don't forget to commit)
-  $ hg st
+  $ hg st --copies
    M s/s
    M t/t
    R a/s