editor: prefer 'intermediate-source' extra to use for HGREVISION environment variable
authorAlexander Drozdov <al.drozdov@gmail.com>
Fri, 10 Apr 2015 08:05:50 +0300
changeset 24687 28d76bc069db
parent 24686 e0e28e910fa3
child 24688 897a0715ee71
editor: 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.
mercurial/ui.py
--- a/mercurial/ui.py	Thu Apr 09 16:25:48 2015 -0400
+++ b/mercurial/ui.py	Fri Apr 10 08:05:50 2015 +0300
@@ -809,7 +809,7 @@
             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