Patchwork D7183: py3: render message about conflicts in chistedit code

login
register
mail settings
Submitter phabricator
Date Oct. 31, 2019, 10:23 p.m.
Message ID <differential-rev-PHID-DREV-dj5slxy2cvxmxorf26rn-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/42627/
State Superseded
Headers show

Comments

phabricator - Oct. 31, 2019, 10:23 p.m.
martinvonz created this revision.
Herald added a reviewer: durin42.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Now you can also reorder commits that (potentially) conflict. Just
  don't try to confirm the changes yet (because then it crashes).

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: martinvonz, durin42, #hg-reviewers
Cc: mercurial-devel
phabricator - Nov. 2, 2019, 4:37 a.m.
martinvonz added a comment.


  In D7183#105653 <https://phab.mercurial-scm.org/D7183#105653>, @yuja wrote:
  
  >>   if len(conflicts) > 0:
  >>
  >> - conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
  >>
  >> +            conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
  >
  > Seems okay, but it was previously a short hash.
  
  Oh, good point, I had forgotten that `hex()` is the full hash. I'll send a patch to switch to `short()`. The full hash is actually used a little further up in the UI, but I'll leave that since it's (probably) been like that for a long time.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel
phabricator - Nov. 2, 2019, 4:42 a.m.
martinvonz added a comment.


  In D7183#105654 <https://phab.mercurial-scm.org/D7183#105654>, @martinvonz wrote:
  
  > In D7183#105653 <https://phab.mercurial-scm.org/D7183#105653>, @yuja wrote:
  >
  >>>   if len(conflicts) > 0:
  >>>
  >>> - conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
  >>>
  >>> +            conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
  >>
  >> Seems okay, but it was previously a short hash.
  >
  > Oh, good point, I had forgotten that `hex()` is the full hash. I'll send a patch to switch to `short()`. The full hash is actually used a little further up in the UI, but I'll leave that since it's (probably) been like that for a long time.
  
  Nope, it hasn't been like that for a long time, I just changed that in this series :( Sorry, I had tried to verify, but I had forgotten that I had aliased hg to be the new version. I'll fix that instance too.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7183/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7183

To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: yuja, mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1425,7 +1425,7 @@ 
 
         conflicts = rule.conflicts
         if len(conflicts) > 0:
-            conflictstr = b','.join(map(lambda r: str(r.ctx), conflicts))
+            conflictstr = b','.join(map(lambda r: r.ctx.hex(), conflicts))
             conflictstr = b"changed files overlap with %s" % conflictstr
         else:
             conflictstr = b'no overlap'
@@ -1464,7 +1464,7 @@ 
 
         conflicts = [r.ctx for r in rules if r.conflicts]
         if len(conflicts) > 0:
-            line = b"potential conflict in %s" % b','.join(map(str, conflicts))
+            line = b"potential conflict in %s" % b','.join(map(pycompat.bytestr, conflicts))
             addln(rulesscr, -1, 0, line, curses.color_pair(COLOR_WARN))
 
         for y, rule in enumerate(rules[start:]):