hgext: use commit hashes to call other commands

Summary:
Search for `commands.(update|rebase)` and change them accordingly to avoid
triggering revnum deprecation messages.

Reviewed By: singhsrb

Differential Revision: D16964237

fbshipit-source-id: c12077c6e143766cba5264cc1fbe0d8cc15c69a2
This commit is contained in:
Jun Wu 2019-08-22 12:57:45 -07:00 committed by Facebook Github Bot
parent 06859de4e2
commit 4a8387c725
3 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ def _moverelative(ui, repo, args, opts, reverse=False):
# If we have both --clean and --rebase, we need to discard any outstanding # If we have both --clean and --rebase, we need to discard any outstanding
# changes now before we attempt to perform any rebases. # changes now before we attempt to perform any rebases.
if opts.get("clean") and opts.get("rebase"): if opts.get("clean") and opts.get("rebase"):
commands.update(ui, repo, rev=repo["."].rev(), clean=True) commands.update(ui, repo, rev=repo["."].hex(), clean=True)
with repo.wlock(), repo.lock(): with repo.wlock(), repo.lock():
# Record the active bookmark, if any. # Record the active bookmark, if any.

View File

@ -53,4 +53,4 @@ def restack(ui, repo, **rebaseopts):
# to do this manually. # to do this manually.
successor = repo.revs("successors(.) - .").last() successor = repo.revs("successors(.) - .").last()
if successor is not None: if successor is not None:
commands.update(ui, repo, rev=successor) commands.update(ui, repo, rev=repo[successor].hex())

View File

@ -260,7 +260,7 @@ def perftestsuitecmd(ui, repo, *revs, **opts):
if opts["rev"]: if opts["rev"]:
ui.status(_("updating to %s...\n") % (opts["rev"])) ui.status(_("updating to %s...\n") % (opts["rev"]))
commands.update(ui, repo, scmutil.revsingle(repo, opts["rev"]).rev()) commands.update(ui, repo, scmutil.revsingle(repo, opts["rev"]).hex())
suite = perftestsuite( suite = perftestsuite(
repo, repo,