changeset 921:8faa91951bb1

svnremoterepo: use and prefer default-push The svnremoterepo class can be constructed without passing it an explicit class. In this case, it previously only considered the default path as the default path to look at. This broke hg svn info when default-push is set to a svn repo but default is not. Chnange it to prefer default-push when available.
author David Schleimer <dschleimer@fb.com>
date Wed, 01 Aug 2012 13:08:56 -0700
parents 1be4ea4f3c0d
children 6b7ac659c855
files hgsubversion/svnrepo.py tests/test_utility_commands.py
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/svnrepo.py
+++ b/hgsubversion/svnrepo.py
@@ -117,6 +117,8 @@ class svnremoterepo(peerrepository):
 
     def __init__(self, ui, path=None):
         self.ui = ui
+        if path is None:
+            path = self.ui.config('paths', 'default-push')
         if path is None:
             path = self.ui.config('paths', 'default')
         if not path:
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -67,6 +67,23 @@ class UtilityTests(test_util.TestBase):
                      'rev': 5,
                      })
         self.assertMultiLineEqual(actual, expected)
+        destpath = self.wc_path + '_clone'
+        test_util.hgclone(u, self.repo, destpath)
+        repo2 = hg.repository(u, destpath)
+        repo2.ui.setconfig('paths', 'default-push',
+                           self.repo.ui.config('paths', 'default'))
+        hg.update(repo2, 'default')
+        svncommands.rebuildmeta(u, repo2, [])
+        u.pushbuffer()
+        svncommands.info(u, repo2)
+        actual = u.popbuffer()
+        expected = (expected_info_output %
+                    {'date': '2008-10-08 01:39:29 +0000 (Wed, 08 Oct 2008)',
+                     'repourl': repourl(repo_path),
+                     'branch': 'trunk',
+                     'rev': 6,
+                     })
+        self.assertMultiLineEqual(actual, expected)
 
     def test_info_single(self):
         repo, repo_path = self.load_and_fetch('two_heads.svndump', subdir='trunk')