Submitter | Yuya Nishihara |
---|---|
Date | April 2, 2015, 1:35 p.m. |
Message ID | <ab6b3165b3f0afc27431.1427981756@mimosa> |
Download | mbox | patch |
Permalink | /patch/8452/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -582,6 +582,13 @@ def rcpath(): _rcpath = osrcpath() return _rcpath +def intrev(repo, rev): + """Return integer for a given revision that can be used in comparison or + arithmetic operation""" + if rev is None: + return len(repo) + return rev + def revsingle(repo, revspec, default='.'): if not revspec and revspec != 0: return repo[default]