changeset 1349:bb9b886090e8

Merge with stable.
author Augie Fackler <raf@durin42.com>
date Sat, 26 Sep 2015 11:35:31 -0400
parents 538bbb927609 (diff) 17876c2c9ce5 (current diff)
children 554eaa682561
files
diffstat 6 files changed, 30 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/layouts/custom.py
+++ b/hgsubversion/layouts/custom.py
@@ -18,7 +18,9 @@ class CustomLayout(base.BaseLayout):
         self.svn_to_hg = {}
         self.hg_to_svn = {}
 
-        for hg_branch, svn_path in meta.ui.configitems('hgsubversionbranch'):
+        meta._gen_cachedconfig('custombranches', {}, configname='hgsubversionbranch')
+
+        for hg_branch, svn_path in meta.custombranches.iteritems():
 
             hg_branch = hg_branch.strip()
             if hg_branch == 'default' or not hg_branch:
--- a/hgsubversion/maps.py
+++ b/hgsubversion/maps.py
@@ -34,7 +34,7 @@ class AuthorMap(dict):
 
         self.super = super(AuthorMap, self)
         self.super.__init__()
-        self.load(self.meta.authors_file)
+        self.load(self.meta.authormap_file)
 
         # append authors specified from the commandline
         clmap = util.configpath(self.meta.ui, 'authormap')
@@ -49,8 +49,8 @@ class AuthorMap(dict):
             return
 
         writing = False
-        if path != self.meta.authors_file:
-            writing = open(self.meta.authors_file, 'a')
+        if path != self.meta.authormap_file:
+            writing = open(self.meta.authormap_file, 'a')
 
         self.meta.ui.debug('reading authormap from %s\n' % path)
         f = open(path, 'r')
--- a/hgsubversion/svnmeta.py
+++ b/hgsubversion/svnmeta.py
@@ -94,6 +94,8 @@ class SVNMeta(object):
                     c = self.ui.configint('hgsubversion', configname, default)
                 elif isinstance(default, list):
                     c = self.ui.configlist('hgsubversion', configname, default)
+                elif isinstance(default, dict):
+                    c = dict(self.ui.configitems(configname))
                 else:
                     c = self.ui.config('hgsubversion', configname, default)
 
@@ -284,7 +286,7 @@ class SVNMeta(object):
         return os.path.join(self.metapath, 'branch_info')
 
     @property
-    def authors_file(self):
+    def authormap_file(self):
         return os.path.join(self.metapath, 'authors')
 
     @property
--- a/hgsubversion/svnwrap/subvertpy_wrapper.py
+++ b/hgsubversion/svnwrap/subvertpy_wrapper.py
@@ -186,7 +186,8 @@ class SubversionRepo(object):
     Note that password stores do not work, the parameter is only here
     to ensure that the API is the same as for the SWIG wrapper.
     """
-    def __init__(self, url='', username='', password='', head=None, password_stores=None):
+    def __init__(self, url='', username='', password='', head=None,
+                 password_stores=None, meta=None):
         parsed = common.parse_url(url, username, password)
         # --username and --password override URL credentials
         self.username = parsed[0]
@@ -210,6 +211,9 @@ class SubversionRepo(object):
         self.hasdiff3 = True
         self.autoprops_config = common.AutoPropsConfig()
 
+        # store the svn meta object for use with branch skipping
+        self.meta = meta
+
     def init_ra_and_client(self):
         """
         Initializes the RA and client layers.
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py
+++ b/hgsubversion/svnwrap/svn_swig_wrapper.py
@@ -205,7 +205,8 @@ class SubversionRepo(object):
 
     It uses the SWIG Python bindings, see above for requirements.
     """
-    def __init__(self, url='', username='', password='', head=None, password_stores=None):
+    def __init__(self, url='', username='', password='', head=None,
+                 password_stores=None, meta=None):
         parsed = common.parse_url(url, username, password)
         # --username and --password override URL credentials
         self.username = parsed[0]
@@ -231,6 +232,9 @@ class SubversionRepo(object):
         self.hasdiff3 = True
         self.autoprops_config = common.AutoPropsConfig()
 
+        # store the svn meta object for use with branch skipping
+        self.meta = meta
+
     def init_ra_and_client(self):
         """Initializes the RA and client layers, because sometimes getting
         unified diffs runs the remote server out of open files.
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -204,6 +204,7 @@ def push(repo, dest, force, revs):
         hasobsolete = False
 
     temporary_commits = []
+    obsmarkers = []
     try:
         # TODO: implement --rev/#rev support
         # TODO: do credentials specified in the URL still work?
@@ -300,9 +301,7 @@ def push(repo, dest, force, revs):
                     if meta.get_source_rev(ctx=c)[0] == pushedrev.revnum:
                         # This is corresponds to the changeset we just pushed
                         if hasobsolete:
-                            ui.note('marking %s as obsoleted by %s\n' %
-                                    (original_ctx.hex(), c.hex()))
-                            obsolete.createmarkers(repo, [(original_ctx, [c])])
+                            obsmarkers.append([(original_ctx, [c])])
 
                     tip_ctx = c
 
@@ -343,7 +342,14 @@ def push(repo, dest, force, revs):
         finally:
             util.swap_out_encoding()
 
-        if not hasobsolete:
+        if hasobsolete:
+            for marker in obsmarkers:
+                obsolete.createmarkers(repo, marker)
+                beforepush = marker[0][0]
+                afterpush = marker[0][1][0]
+                ui.note('marking %s as obsoleted by %s\n' %
+                        (beforepush.hex(), afterpush.hex()))
+        else:
             # strip the original changesets since the push was
             # successful and changeset obsolescence is unavailable
             util.strip(ui, repo, outgoing, "all")
@@ -396,6 +402,7 @@ def pull(repo, source, heads=[], force=F
         svn = source.svn
         if meta is None:
             meta = repo.svnmeta(svn.uuid, svn.subdir)
+        svn.meta = meta
 
         stopat_rev = util.parse_revnum(svn, checkout)