Mercurial > hgsubversion
changeset 339:13998e698d3e
Merge with crew.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Tue, 26 May 2009 22:22:00 -0500 |
parents | 47c0110046dc (current diff) 4f4db3d2fdbb (diff) |
children | 88ba55ad58c0 |
files | hgsubversion/hg_delta_editor.py hgsubversion/svnexternals.py hgsubversion/svnwrap/svn_swig_wrapper.py hgsubversion/svnwrap/tests/test_svnwrap.py |
diffstat | 4 files changed, 21 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/hg_delta_editor.py +++ b/hgsubversion/hg_delta_editor.py @@ -420,7 +420,11 @@ class HgChangeReceiver(delta.Editor): for tags_path in self.tag_locations: if path and (path.startswith(tags_path) and len(path) > len('%s/' % tags_path)): - tag, _, subpath = path[len(tags_path)+1:].partition('/') + tag = path[len(tags_path)+1:] + if '/' in tag: + tag, subpath = tag.split('/', 1) + else: + subpath = '' return (subpath, tag, '%s/%s' % (tags_path, tag)) return (None, None, None)
--- a/hgsubversion/svnexternals.py +++ b/hgsubversion/svnexternals.py @@ -242,8 +242,8 @@ class externalsupdater: args = ['svn'] + args self.ui.debug(_('updating externals: %r, cwd=%s\n') % (args, cwd)) shell = os.name == 'nt' - subprocess.check_call(args, cwd=cwd, shell=shell, - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if subprocess.call(args, cwd=cwd, shell=shell) != 0: + raise hgutil.Abort("subprocess '%s' failed" % ' '.join(args)) def updateexternals(ui, args, repo, **opts): """update repository externals @@ -282,4 +282,3 @@ def updateexternals(ui, args, repo, **op raise hgutil.Abort(_('unknown update actions: %r') % action) file(repo.join('svn/externals'), 'wb').write(newext) -
--- a/hgsubversion/svnwrap/svn_swig_wrapper.py +++ b/hgsubversion/svnwrap/svn_swig_wrapper.py @@ -6,9 +6,13 @@ import sys import tempfile import urlparse import urllib -import hashlib import collections +import warnings +warnings.filterwarnings('ignore', + module='svn.core', + category=DeprecationWarning) + from svn import client from svn import core from svn import delta
--- a/hgsubversion/svnwrap/tests/test_svnwrap.py +++ b/hgsubversion/svnwrap/tests/test_svnwrap.py @@ -12,14 +12,15 @@ class TestBasicRepoLayout(unittest.TestC def setUp(self): self.tmpdir = tempfile.mkdtemp('svnwrap_test') self.repo_path = '%s/testrepo' % self.tmpdir - os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', + os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', self.repo_path,]) - inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', + inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', 'project_root_at_repo_root.svndump')) - proc = subprocess.check_call(['svnadmin', 'load', self.repo_path,], + proc = subprocess.call(['svnadmin', 'load', self.repo_path,], stdin=inp, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + assert proc == 0 self.repo = svnwrap.SubversionRepo('file://%s' % self.repo_path) def tearDown(self): @@ -57,13 +58,14 @@ class TestRootAsSubdirOfRepo(TestBasicRe def setUp(self): self.tmpdir = tempfile.mkdtemp('svnwrap_test') self.repo_path = '%s/testrepo' % self.tmpdir - os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', + os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', self.repo_path,]) - inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', + inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', 'project_root_not_repo_root.svndump')) - subprocess.check_call(['svnadmin', 'load', self.repo_path,], + ret = subprocess.call(['svnadmin', 'load', self.repo_path,], stdin=inp, close_fds=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - self.repo = svnwrap.SubversionRepo('file://%s/dummyproj' % + assert ret == 0 + self.repo = svnwrap.SubversionRepo('file://%s/dummyproj' % self.repo_path)