diff hgsubversion/layouts/standard.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 66395f232b7c
line wrap: on
line diff
--- a/hgsubversion/layouts/standard.py
+++ b/hgsubversion/layouts/standard.py
@@ -19,3 +19,13 @@ class StandardLayout(base.BaseLayout):
         elif branch.startswith('../'):
             return branch[3:]
         return 'branches/%s' % branch
+
+    def remotepath(self, branch, subdir='/'):
+        branchpath = 'trunk'
+        if branch:
+            if branch.startswith('../'):
+                branchpath = branch[3:]
+            else:
+                branchpath = 'branches/%s' % branch
+
+        return '%s/%s' % (subdir or '', branchpath)