D3081: wireproto: use repo.lookup() for lookup command
This revision was automatically updated to reflect the committed changes. Closed by commit rHGac666c5c2e0c: wireproto: use repo.lookup() for lookup command (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D3081?vs=7655&id=7667 REVISION DETAIL https://phab.mercurial-scm.org/D3081 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1014,8 +1014,8 @@ def lookup(repo, proto, key): try: k = encoding.tolocal(key) -c = repo[k] -r = c.hex() +n = repo.lookup(k) +r = hex(n) success = 1 except Exception as inst: r = stringutil.forcebytestr(inst) To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3081: wireproto: use repo.lookup() for lookup command
indygreg accepted this revision. indygreg added a comment. This revision is now accepted and ready to land. The fact that this wasn't using `lookup()` is mind numbing. What the wire protocol command handlers should be doing in many cases is calling `repo.peer().()`. Now you can see how bad the wire protocol code is :/ REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3081 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
D3081: wireproto: use repo.lookup() for lookup command
martinvonz created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY I'm trying to reduce use of repo[] and this seems like an obvious place to use repo.lookup(). REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D3081 AFFECTED FILES mercurial/wireproto.py CHANGE DETAILS diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -1014,8 +1014,8 @@ def lookup(repo, proto, key): try: k = encoding.tolocal(key) -c = repo[k] -r = c.hex() +n = repo.lookup(k) +r = hex(n) success = 1 except Exception as inst: r = stringutil.forcebytestr(inst) To: martinvonz, #hg-reviewers Cc: mercurial-devel ___ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel