diff mercurial/subrepo.py @ 21401:2c364f7801c8

subrepo: use subrepo shortid method to generate subrepo diverged promptchoice We were always using only the first 12 characters of the subrepo revision id when generating the "subrepo diverged" promptchoice. This is not necessarily correct for non mercurial subrepos.
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Wed, 07 May 2014 00:13:22 +0200
parents 78a60daacea8
children 652e07debf10
line wrap: on
line diff
--- a/mercurial/subrepo.py	Wed May 07 00:08:20 2014 +0200
+++ b/mercurial/subrepo.py	Wed May 07 00:13:22 2014 +0200
@@ -205,12 +205,13 @@
                 sm[s] = r
             else:
                 debug(s, "both sides changed")
+                srepo = wctx.sub(s)
                 option = repo.ui.promptchoice(
                     _(' subrepository %s diverged (local revision: %s, '
                       'remote revision: %s)\n'
                       '(M)erge, keep (l)ocal or keep (r)emote?'
                       '$$ &Merge $$ &Local $$ &Remote')
-                    % (s, l[1][:12], r[1][:12]), 0)
+                    % (s, srepo.shortid(l[1]), srepo.shortid(r[1])), 0)
                 if option == 0:
                     wctx.sub(s).merge(r)
                     sm[s] = l