Submitter | Durham Goode |
---|---|
Date | Feb. 6, 2014, 4:37 a.m. |
Message ID | <d16e720434515abbe537.1391661464@dev010.prn1.facebook.com> |
Download | mbox | patch |
Permalink | /patch/3489/ |
State | Accepted |
Commit | 6f3fb6a974e0ea9be959c055ca6934bf94018ec7 |
Headers | show |
Comments
On Wed, 2014-02-05 at 20:37 -0800, Durham Goode wrote: > # HG changeset patch > # User Durham Goode <durham@fb.com> > # Date 1391660548 28800 > # Wed Feb 05 20:22:28 2014 -0800 > # Node ID d16e720434515abbe537e03a102ce151d1931165 > # Parent aa51392da50763f3e7b9ec40acc3a97682488b66 > template: fix shortest(node) function in pure mercurial Queued for default, thanks.
Patch
diff --git a/mercurial/templater.py b/mercurial/templater.py --- a/mercurial/templater.py +++ b/mercurial/templater.py @@ -368,7 +368,14 @@ cl = mapping['ctx']._repo.changelog def isvalid(test): try: - cl.index.partialmatch(test) + try: + cl.index.partialmatch(test) + except AttributeError: + # Pure mercurial doesn't support partialmatch on the index. + # Fallback to the slow way. + if cl._partialmatch(test) is None: + return False + try: int(test) return False