Patchwork [4,of,4,V2] subrepo: show detailed revision info for the divergent subrepo revisions

login
register
mail settings
Submitter Angel Ezquerra
Date May 10, 2014, 11:38 p.m.
Message ID <1ea80c486e4ec567e6c0.1399765117@Angel-PC.localdomain>
Download mbox | patch
Permalink /patch/4725/
State Accepted
Headers show

Comments

Angel Ezquerra - May 10, 2014, 11:38 p.m.
# HG changeset patch
# User Angel Ezquerra <angel.ezquerra@gmail.com>
# Date 1399415105 -7200
#      Wed May 07 00:25:05 2014 +0200
# Node ID 1ea80c486e4ec567e6c02d54ba88e89fcb0df0d4
# Parent  6860a9cad193936489dcb0ddf0c9db5867545222
subrepo: show detailed revision info for the divergent subrepo revisions

Up until now it was very hard to decide what to do when mercurial showed a
"subrepo diverged" prompt. We were only showing the revision id, but this is
hardly enough information to decide what to do.

Now we show the revision details for the local and remote subrepos so that the
user can take a better decision.
Pierre-Yves David - May 15, 2014, 7:29 a.m.
On 05/10/2014 04:38 PM, Angel Ezquerra wrote:
> # HG changeset patch
> # User Angel Ezquerra <angel.ezquerra@gmail.com>
> # Date 1399415105 -7200
> #      Wed May 07 00:25:05 2014 +0200
> # Node ID 1ea80c486e4ec567e6c02d54ba88e89fcb0df0d4
> # Parent  6860a9cad193936489dcb0ddf0c9db5867545222
> subrepo: show detailed revision info for the divergent subrepo revisions
>
> Up until now it was very hard to decide what to do when mercurial showed a
> "subrepo diverged" prompt. We were only showing the revision id, but this is
> hardly enough information to decide what to do.
>
> Now we show the revision details for the local and remote subrepos so that the
> user can take a better decision.

I've queued (and pushed to clowncopter) this 4 patches after fixing the 
description of patches 3.

I would happily takes a patch that adds some doc string.


>
> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
> --- a/mercurial/subrepo.py
> +++ b/mercurial/subrepo.py
> @@ -209,9 +209,15 @@
>                   option = repo.ui.promptchoice(
>                       _(' subrepository %s diverged (local revision: %s, '
>                         'remote revision: %s)\n'
> +                      'subrepository %s local revision details:\n%s\n\n'
> +                      'subrepository %s remote revision details:\n%s\n\n'

Notes: This is about to "conflict" with Durham changes on labels.
(not landed yet)
Angel Ezquerra - May 15, 2014, 7:53 a.m.
On Thu, May 15, 2014 at 9:29 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
>
> On 05/10/2014 04:38 PM, Angel Ezquerra wrote:
>>
>> # HG changeset patch
>> # User Angel Ezquerra <angel.ezquerra@gmail.com>
>> # Date 1399415105 -7200
>> #      Wed May 07 00:25:05 2014 +0200
>> # Node ID 1ea80c486e4ec567e6c02d54ba88e89fcb0df0d4
>> # Parent  6860a9cad193936489dcb0ddf0c9db5867545222
>> subrepo: show detailed revision info for the divergent subrepo revisions
>>
>> Up until now it was very hard to decide what to do when mercurial showed a
>> "subrepo diverged" prompt. We were only showing the revision id, but this
>> is
>> hardly enough information to decide what to do.
>>
>> Now we show the revision details for the local and remote subrepos so that
>> the
>> user can take a better decision.
>
>
> I've queued (and pushed to clowncopter) this 4 patches after fixing the
> description of patches 3.
>
> I would happily takes a patch that adds some doc string.

Thanks! I will send a patch that adds docstings as soon as I have some time.


>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>> --- a/mercurial/subrepo.py
>> +++ b/mercurial/subrepo.py
>> @@ -209,9 +209,15 @@
>>                   option = repo.ui.promptchoice(
>>                       _(' subrepository %s diverged (local revision: %s, '
>>                         'remote revision: %s)\n'
>> +                      'subrepository %s local revision details:\n%s\n\n'
>> +                      'subrepository %s remote revision details:\n%s\n\n'
>
>
> Notes: This is about to "conflict" with Durham changes on labels.
> (not landed yet)

Is there anything I must do about this?

Cheers,

Angel
Pierre-Yves David - May 15, 2014, 8:09 a.m.
On 05/15/2014 12:53 AM, Angel Ezquerra wrote:
>>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>>> >>--- a/mercurial/subrepo.py
>>> >>+++ b/mercurial/subrepo.py
>>> >>@@ -209,9 +209,15 @@
>>> >>                   option = repo.ui.promptchoice(
>>> >>                       _(' subrepository %s diverged (local revision: %s, '
>>> >>                         'remote revision: %s)\n'
>>> >>+                      'subrepository %s local revision details:\n%s\n\n'
>>> >>+                      'subrepository %s remote revision details:\n%s\n\n'
>> >
>> >
>> >Notes: This is about to "conflict" with Durham changes on labels.
>> >(not landed yet)
> Is there anything I must do about this?

Once the durham series will make it into core we can think of putting 
the local/remote terminologie of subrepo with the other name used in core.

I recommend not touching anything for now as it is going to conflict 
with Durham series.
Angel Ezquerra - May 15, 2014, 8:11 a.m.
On Thu, May 15, 2014 at 10:09 AM, Pierre-Yves David
<pierre-yves.david@ens-lyon.org> wrote:
>
>
> On 05/15/2014 12:53 AM, Angel Ezquerra wrote:
>>>>
>>>> diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
>>>> >>--- a/mercurial/subrepo.py
>>>> >>+++ b/mercurial/subrepo.py
>>>> >>@@ -209,9 +209,15 @@
>>>> >>                   option = repo.ui.promptchoice(
>>>> >>                       _(' subrepository %s diverged (local revision:
>>>> >> %s, '
>>>> >>                         'remote revision: %s)\n'
>>>> >>+                      'subrepository %s local revision
>>>> >> details:\n%s\n\n'
>>>> >>+                      'subrepository %s remote revision
>>>> >> details:\n%s\n\n'
>>>
>>> >
>>> >
>>> >Notes: This is about to "conflict" with Durham changes on labels.
>>> >(not landed yet)
>>
>> Is there anything I must do about this?
>
>
> Once the durham series will make it into core we can think of putting the
> local/remote terminologie of subrepo with the other name used in core.
>
> I recommend not touching anything for now as it is going to conflict with
> Durham series.

OK.

BTW I believe that the "local/remote" terminology in the subrepo
messages is really odd and confusing. IMHO there is nothing "remote"
about the subrepo revision on the other parent in a merge. IMHO it
would be best to change those to say either parent 1 and parent 2 or
to say local/other.

Cheers,

Angel

Patch

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -209,9 +209,15 @@ 
                 option = repo.ui.promptchoice(
                     _(' subrepository %s diverged (local revision: %s, '
                       'remote revision: %s)\n'
+                      'subrepository %s local revision details:\n%s\n\n'
+                      'subrepository %s remote revision details:\n%s\n\n'
                       '(M)erge, keep (l)ocal or keep (r)emote?'
                       '$$ &Merge $$ &Local $$ &Remote')
-                    % (s, srepo.shortid(l[1]), srepo.shortid(r[1])), 0)
+                    % (s,
+                       srepo.shortid(l[1]),
+                       srepo.shortid(r[1]),
+                       s, srepo.revdetails(l[1]),
+                       s, srepo.revdetails(r[1])), 0)
                 if option == 0:
                     wctx.sub(s).merge(r)
                     sm[s] = l
diff --git a/tests/test-mq-subrepo.t b/tests/test-mq-subrepo.t
--- a/tests/test-mq-subrepo.t
+++ b/tests/test-mq-subrepo.t
@@ -264,6 +264,19 @@ 
   $ hg qpush
   applying 1.diff
    subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
+  subrepository sub local revision details:
+  changeset:   0:b2fdb12cd82b
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     0sub
+  
+  subrepository sub remote revision details:
+  changeset:   1:aa037b301eba
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   now at: 1.diff
diff --git a/tests/test-subrepo-git.t b/tests/test-subrepo-git.t
--- a/tests/test-subrepo-git.t
+++ b/tests/test-subrepo-git.t
@@ -156,6 +156,12 @@ 
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg merge 2>/dev/null
    subrepository s diverged (local revision: 7969594, remote revision: aa84837)
+  subrepository s local revision details:
+  changeset:   79695940086840c99328513acbe35f90fcd55e57
+  
+  subrepository s remote revision details:
+  changeset:   aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   pulling subrepo s from $TESTTMP/gitroot
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -465,6 +471,12 @@ 
   $ cd ..
   $ hg update 4
    subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
+  subrepository s local revision details:
+  changeset:   da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
+  
+  subrepository s remote revision details:
+  changeset:   aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (da5f5b1) or (r)emote source (aa84837)?
@@ -492,6 +504,12 @@ 
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
+  subrepository s local revision details:
+  changeset:   32a343883b74769118bb1d3b4b1fbf9156f4dddc
+  
+  subrepository s remote revision details:
+  changeset:   da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ (in checked out version)
   use (l)ocal source (32a3438) or (r)emote source (da5f5b1)?
@@ -515,6 +533,12 @@ 
   1+
   $ hg update 7
    subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
+  subrepository s local revision details:
+  changeset:   32a343883b74769118bb1d3b4b1fbf9156f4dddc
+  
+  subrepository s remote revision details:
+  changeset:   32a343883b74769118bb1d3b4b1fbf9156f4dddc
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (32a3438) or (r)emote source (32a3438)?
diff --git a/tests/test-subrepo-svn.t b/tests/test-subrepo-svn.t
--- a/tests/test-subrepo-svn.t
+++ b/tests/test-subrepo-svn.t
@@ -320,6 +320,12 @@ 
   $ cd ..
   $ hg update tip
    subrepository s diverged (local revision: 2, remote revision: 3)
+  subrepository s local revision details:
+  changeset:   2
+  
+  subrepository s remote revision details:
+  changeset:   3
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (2) or (r)emote source (3)?
@@ -352,6 +358,12 @@ 
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 3, remote revision: 2)
+  subrepository s local revision details:
+  changeset:   3
+  
+  subrepository s remote revision details:
+  changeset:   2
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ (in checked out version)
   use (l)ocal source (1) or (r)emote source (2)?
@@ -376,6 +388,12 @@ 
   1+
   $ hg update tip
    subrepository s diverged (local revision: 3, remote revision: 3)
+  subrepository s local revision details:
+  changeset:   3
+  
+  subrepository s remote revision details:
+  changeset:   3
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (1) or (r)emote source (3)?
@@ -411,6 +429,12 @@ 
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 3, remote revision: 2)
+  subrepository s local revision details:
+  changeset:   3
+  
+  subrepository s remote revision details:
+  changeset:   2
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
diff --git a/tests/test-subrepo.t b/tests/test-subrepo.t
--- a/tests/test-subrepo.t
+++ b/tests/test-subrepo.t
@@ -275,6 +275,33 @@ 
   subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4
     subrepo t: both sides changed 
    subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
+  subrepository t local revision details:
+  changeset:   3:20a0db6fbf6c3d2836e6519a642ae929bfc67c0e
+  tag:         tip
+  phase:       draft
+  parent:      1:6747d179aa9a688023c4b0cad32e4c92bb7f34ad
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    3:ddbaa934dd5beeded95c14933b5685a8ff80bdb7
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       t
+  extra:       branch=default
+  description:
+  10
+  
+  subrepository t remote revision details:
+  changeset:   2:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4
+  phase:       draft
+  parent:      1:6747d179aa9a688023c4b0cad32e4c92bb7f34ad
+  parent:      -1:0000000000000000000000000000000000000000
+  manifest:    2:2ccf484c365ca641892a954317fdc2ccf6ffa421
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  files:       t
+  extra:       branch=default
+  description:
+  7
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   merging subrepo t
     searching for copies back to rev 2
@@ -657,6 +684,23 @@ 
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 4    # try to merge default into br again
    subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
+  subrepository s local revision details:
+  changeset:   5:f8f13b33206e
+  branch:      br
+  tag:         tip
+  parent:      3:b7ed2d1f435d
+  parent:      4:a3f9062a4f88
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
+  subrepository s remote revision details:
+  changeset:   4:a3f9062a4f88
+  parent:      2:79f5346db928
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     1
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -974,11 +1018,38 @@ 
   e95bcfa18a35+
   $ hg update tip
    subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
+  subrepository s local revision details:
+  changeset:   2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     s1
+  
+  subrepository s remote revision details:
+  changeset:   5:12a213df6fa9
+  tag:         tip
+  parent:      2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)?
    l
    subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
+  subrepository t local revision details:
+  changeset:   4:e95bcfa18a35
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11
+  
+  subrepository t remote revision details:
+  changeset:   5:52c0adc0515a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ
   use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)?
@@ -1009,8 +1080,36 @@ 
   $ cd ..
   $ hg update 10
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
+  subrepository s local revision details:
+  changeset:   5:12a213df6fa9
+  tag:         tip
+  parent:      2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
+  subrepository s remote revision details:
+  changeset:   2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     s1
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
+  subrepository t local revision details:
+  changeset:   5:52c0adc0515a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
+  subrepository t remote revision details:
+  changeset:   3:20a0db6fbf6c
+  parent:      1:6747d179aa9a
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     10
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ (in checked out version)
   use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)?
@@ -1036,11 +1135,41 @@ 
   7af322bc1198+
   $ hg update tip
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
+  subrepository s local revision details:
+  changeset:   5:12a213df6fa9
+  tag:         tip
+  parent:      2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
+  subrepository s remote revision details:
+  changeset:   5:12a213df6fa9
+  tag:         tip
+  parent:      2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for s differ
   use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)?
    l
    subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
+  subrepository t local revision details:
+  changeset:   5:52c0adc0515a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
+  subrepository t remote revision details:
+  changeset:   5:52c0adc0515a
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     13
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
    subrepository sources for t differ
   use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)?
@@ -1070,6 +1199,20 @@ 
   $ cd ..
   $ hg update 11
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
+  subrepository s local revision details:
+  changeset:   5:12a213df6fa9
+  tag:         tip
+  parent:      2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     12
+  
+  subrepository s remote revision details:
+  changeset:   2:fc627a69481f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     s1
+  
   (M)erge, keep (l)ocal or keep (r)emote? m
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved