changeset 1119:2efc4abd4602

svnexternals: remove pre-1.9 pegrev code
author Sean Farley <sean.michael.farley@gmail.com>
date Fri, 06 Sep 2013 19:22:39 -0500
parents 5490194e688e
children 8a734c3e9b8d
files hgsubversion/svnexternals.py
diffstat 1 files changed, 8 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnexternals.py
+++ b/hgsubversion/svnexternals.py
@@ -5,17 +5,12 @@ from mercurial import util as hgutil
 from mercurial.i18n import _
 from mercurial import subrepo
 
-passpegrev = True # see svnsubrepo below
 try:
-    canonpath = hgutil.canonpath
+    from mercurial import scmutil
+    canonpath = scmutil.canonpath
 except (ImportError, AttributeError):
-    passpegrev = False
-    try:
-        from mercurial import scmutil
-        canonpath = scmutil.canonpath
-    except (ImportError, AttributeError):
-        from mercurial import pathutil
-        canonpath = pathutil.canonpath
+    from mercurial import pathutil
+    canonpath = pathutil.canonpath
 
 import util
 
@@ -408,13 +403,10 @@ class svnsubrepo(subrepo.svnsubrepo):
             svnurl = self._ctx._repo.ui.expandpath('default')
             svnroot = getsvninfo(util.normalize_url(svnurl))[1]
             source = resolvesource(self._ui, svnroot, source)
-        # hg < 1.9 svnsubrepo calls "svn checkout" with --rev
-        # only, so peg revisions are correctly used. 1.9 and
-        # higher, append the rev as a peg revision to the source
-        # URL, so we cannot add our own. We assume that "-r10
-        # url@2" will be similar to "url@10" most of the time.
-        if pegrev is not None and passpegrev:
-            source = source + '@' + pegrev
+        # hg 1.9 and higher, append the rev as a peg revision to
+        # the source URL, so we cannot add our own. We assume
+        # that "-r10 url@2" will be similar to "url@10" most of
+        # the time.
         state = (source, state[1])
         return super(svnsubrepo, self).get(state, *args, **kwargs)