# HG changeset patch
# User Matt Harbison <
matt_h...@yahoo.com>
# Date 1700157763 18000
# Thu Nov 16 13:02:43 2023 -0500
# Branch stable
# Node ID 2c5ec6c6eb671df2171cca8f57c373cfd41fbd15
# Parent 9da7ef8afe68e83ed66e98d5ac7c96422c49285a
# EXP-Topic revdetails-fixes
revdetails: port to modern Mercurial API (fixes #5957)
This worked if the revision was a special symbolic name, but crashed if it was a
short hash, because `repo[rev]` stopped accepting short hashes way back in
Mercurial 4.8 (hg 3d35304bd09b). Additionally, the `rev` arg defaulted to '',
so the fallback to '.' was never taken. `scmutil.revsingle()` handles that
fallback properly, given a rev of ''.
diff --git a/tortoisehg/hgqt/run.py b/tortoisehg/hgqt/run.py
--- a/tortoisehg/hgqt/run.py
+++ b/tortoisehg/hgqt/run.py
@@ -1249,7 +1249,7 @@
from tortoisehg.hgqt import revdetails as revdetailsmod
repo = repoagent.rawRepo()
os.chdir(repo.root)
- rev = opts.get('rev', '.')
+ rev = scmutil.revsingle(repo, opts.get('rev')).rev()
return revdetailsmod.RevDetailsDialog(repoagent, rev=rev)
@command(b'revert', [], _('thg revert [FILE]...'))