diff hgsubversion/svnmeta.py @ 1014:0ed7cf23e801

layouts: refactor path component of convinfo generation into layouts lib This adds code responsible for producing an absolute path within the subversion repository to the new layout objects. It also uses that code to generate the path component of the conversion info we stick into extra.
author David Schleimer <dschleimer@fb.com>
date Fri, 26 Apr 2013 11:14:06 -0700
parents d507c1a12dcb
children 8feff33e387d
line wrap: on
line diff
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -235,17 +235,10 @@ class SVNMeta(object):
         if subdir and subdir[0] != '/':
             subdir = '/' + subdir
 
-        if self.layout == 'single':
-            path = subdir or '/'
-        else:
-            branchpath = 'trunk'
-            if branch:
-                extra['branch'] = branch
-                if branch.startswith('../'):
-                    branchpath = branch[3:]
-                else:
-                    branchpath = 'branches/%s' % branch
-            path = '%s/%s' % (subdir, branchpath)
+        path = self.layoutobj.remotepath(branch, subdir)
+
+        if branch:
+            extra['branch'] = branch
 
         extra['convert_revision'] = 'svn:%(uuid)s%(path)s@%(rev)s' % {
             'uuid': self.uuid,