Patchwork merge: make 'keep' message more descriptive

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 5, 2014, 7:59 p.m.
Message ID <89d44cd0532a11b809df.1417809573@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7013/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Dec. 5, 2014, 7:59 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1417644200 28800
#      Wed Dec 03 14:03:20 2014 -0800
# Node ID 89d44cd0532a11b809dfc65c72a0bb5071f67951
# Parent  406dfc63a1ad71213dccc1a45de99a3c5d5ac460
merge: make 'keep' message more descriptive

Most merge action messages don't describe the action itself, they
describe the reason the action was taken. The only exeption is the 'k'
action, for which the message is just "keep" and instead there is a
code comment folling it that says "remote unchanged". Let's move that
comment into the merge action message.
Matt Mackall - Dec. 5, 2014, 8:06 p.m.
On Fri, 2014-12-05 at 11:59 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1417644200 28800
> #      Wed Dec 03 14:03:20 2014 -0800
> # Node ID 89d44cd0532a11b809dfc65c72a0bb5071f67951
> # Parent  406dfc63a1ad71213dccc1a45de99a3c5d5ac460
> merge: make 'keep' message more descriptive

Queued for default, thanks.

Patch

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -427,7 +427,7 @@ 
                 fla = ma.flags(f)
                 nol = 'l' not in fl1 + fl2 + fla
                 if n2 == a and fl2 == fla:
-                    actions['k'].append((f, (), "keep")) # remote unchanged
+                    actions['k'].append((f, (), "remote unchanged"))
                 elif n1 == a and fl1 == fla: # local unchanged - use remote
                     if n1 == n2: # optimization: keep local content
                         actions['e'].append((f, (fl2,), "update permissions"))
diff --git a/tests/test-graft.t b/tests/test-graft.t
--- a/tests/test-graft.t
+++ b/tests/test-graft.t
@@ -168,7 +168,7 @@ 
    e: remote is newer -> g
   getting e
   updating: e 1/1 files (100.00%)
-   b: keep -> k
+   b: remote unchanged -> k
   e
   grafting revision 4
     searching for copies back to rev 1
@@ -179,7 +179,7 @@ 
    d: remote is newer -> g
   getting d
   updating: d 1/2 files (50.00%)
-   b: keep -> k
+   b: remote unchanged -> k
    e: versions differ -> m
   updating: e 2/2 files (100.00%)
   picked tool 'internal:merge' for e (binary False symlink False)
diff --git a/tests/test-issue672.t b/tests/test-issue672.t
--- a/tests/test-issue672.t
+++ b/tests/test-issue672.t
@@ -40,7 +40,7 @@ 
    1a: remote created -> g
   getting 1a
   updating: 1a 2/2 files (100.00%)
-   2: keep -> k
+   2: remote unchanged -> k
   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
diff --git a/tests/test-merge-criss-cross.t b/tests/test-merge-criss-cross.t
--- a/tests/test-merge-criss-cross.t
+++ b/tests/test-merge-criss-cross.t
@@ -141,7 +141,7 @@ 
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
-   f2: keep -> k
+   f2: remote unchanged -> k
    f1: versions differ -> m
   
   auction for merging merge bids
@@ -152,7 +152,7 @@ 
    f1: remote is newer -> g
   getting f1
   updating: f1 1/1 files (100.00%)
-   f2: keep -> k
+   f2: remote unchanged -> k
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
@@ -176,7 +176,7 @@ 
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 0f6b37dbe527, local: adfe50279922+, remote: 3b08d01b0ab5
-   f1: keep -> k
+   f1: remote unchanged -> k
    f2: versions differ -> m
   
   calculating bids for ancestor 40663881a6dd
@@ -195,7 +195,7 @@ 
    f2: remote is newer -> g
   getting f2
   updating: f2 1/1 files (100.00%)
-   f1: keep -> k
+   f1: remote unchanged -> k
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
@@ -249,7 +249,7 @@ 
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 40663881a6dd, local: 3b08d01b0ab5+, remote: adfe50279922
-   f2: keep -> k
+   f2: remote unchanged -> k
    f1: versions differ -> m
   
   auction for merging merge bids
@@ -260,7 +260,7 @@ 
    f1: remote is newer -> g
   getting f1
   updating: f1 1/1 files (100.00%)
-   f2: keep -> k
+   f2: remote unchanged -> k
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
 
diff --git a/tests/test-rename-merge2.t b/tests/test-rename-merge2.t
--- a/tests/test-rename-merge2.t
+++ b/tests/test-rename-merge2.t
@@ -88,7 +88,7 @@ 
    ancestor: 924404dff337, local: e300d1c794ec+, remote: 4ce40f5aca24
    preserving a for resolve of b
    preserving rev for resolve of rev
-   a: keep -> k
+   a: remote unchanged -> k
    b: remote copied from a -> m
   updating: b 1/2 files (50.00%)
   picked tool 'python ../merge' for b (binary False symlink False)
@@ -573,7 +573,7 @@ 
    ancestor: 924404dff337, local: 0b76e65c8289+, remote: 4ce40f5aca24
    preserving b for resolve of b
    preserving rev for resolve of rev
-   a: keep -> k
+   a: remote unchanged -> k
    b: both created -> m
   updating: b 1/2 files (50.00%)
   picked tool 'python ../merge' for b (binary False symlink False)