Patchwork ui: edit(): graft: prefer 'intermediate-source' extra to use for HGREVISION environment variable

login
register
mail settings
Submitter Alexander Drozdov
Date April 10, 2015, 5:17 a.m.
Message ID <6e27f5b6ff772e320021.1428643049@localhost6.localdomain6>
Download mbox | patch
Permalink /patch/8589/
State Accepted
Headers show

Comments

Alexander Drozdov - April 10, 2015, 5:17 a.m.
# HG changeset patch
# User Alexander Drozdov <al.drozdov@gmail.com>
# Date 1428642350 -10800
#      Fri Apr 10 08:05:50 2015 +0300
# Node ID 6e27f5b6ff772e32002180c75ebac47414b9ee0b
# Parent  e0e28e910fa3797fd0aa4f818e9b33c5bcbf0e53
ui: edit(): graft: prefer 'intermediate-source' extra to use for HGREVISION environment variable

Revision 51930a7180bd ('graft: record intermediate grafts in extras') introduced
'intermediate-source' extra which refers to the closest graft source.

As 'intermediate-source' extra provides more detailed information about the source
changeset than 'source' one, it is better to prefer the first one to use as a
value of HGREVISION environment variable for an editor.
Matt Mackall - April 10, 2015, 7:19 p.m.
On Fri, 2015-04-10 at 08:17 +0300, Alexander Drozdov wrote:
> # HG changeset patch
> # User Alexander Drozdov <al.drozdov@gmail.com>
> # Date 1428642350 -10800
> #      Fri Apr 10 08:05:50 2015 +0300
> # Node ID 6e27f5b6ff772e32002180c75ebac47414b9ee0b
> # Parent  e0e28e910fa3797fd0aa4f818e9b33c5bcbf0e53
> ui: edit(): graft: prefer 'intermediate-source' extra to use for HGREVISION environment variable

Queued for default, thanks. In the future, please use a single simple
keyword. Here, I've used "editor".

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -809,7 +809,7 @@  class ui(object):
             environ = {'HGUSER': user}
             if 'transplant_source' in extra:
                 environ.update({'HGREVISION': hex(extra['transplant_source'])})
-            for label in ('source', 'rebase_source'):
+            for label in ('intermediate-source', 'source', 'rebase_source'):
                 if label in extra:
                     environ.update({'HGREVISION': extra[label]})
                     break