equal
deleted
inserted
replaced
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
8 from i18n import _ |
8 from i18n import _ |
9 from mercurial.node import nullrev |
9 from mercurial.node import nullrev, wdirrev |
10 import util, error, osutil, revset, similar, encoding, phases |
10 import util, error, osutil, revset, similar, encoding, phases |
11 import pathutil |
11 import pathutil |
12 import match as matchmod |
12 import match as matchmod |
13 import os, errno, re, glob, tempfile, shutil, stat |
13 import os, errno, re, glob, tempfile, shutil, stat |
14 |
14 |
660 _rcpath.append(p) |
660 _rcpath.append(p) |
661 else: |
661 else: |
662 _rcpath = osrcpath() |
662 _rcpath = osrcpath() |
663 return _rcpath |
663 return _rcpath |
664 |
664 |
665 def intrev(repo, rev): |
665 def intrev(rev): |
666 """Return integer for a given revision that can be used in comparison or |
666 """Return integer for a given revision that can be used in comparison or |
667 arithmetic operation""" |
667 arithmetic operation""" |
668 if rev is None: |
668 if rev is None: |
669 return len(repo) |
669 return wdirrev |
670 return rev |
670 return rev |
671 |
671 |
672 def revsingle(repo, revspec, default='.'): |
672 def revsingle(repo, revspec, default='.'): |
673 if not revspec and revspec != 0: |
673 if not revspec and revspec != 0: |
674 return repo[default] |
674 return repo[default] |