# HG changeset patch # User Augie Fackler # Date 1242684566 18000 # Node ID 4f4db3d2fdbb66b282109ba694c8577353cd4f34 # Parent c4061e57974c27e95d6eb2fb95ad0ea00632b791 2.4 compat fixes. diff --git a/hg_delta_editor.py b/hg_delta_editor.py --- a/hg_delta_editor.py +++ b/hg_delta_editor.py @@ -408,7 +408,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) diff --git a/svnexternals.py b/svnexternals.py --- a/svnexternals.py +++ b/svnexternals.py @@ -240,7 +240,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) + 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 @@ -278,4 +279,3 @@ def updateexternals(ui, args, repo, **op raise hgutil.Abort(_('unknown update actions: %r') % action) file(repo.join('svn/externals'), 'wb').write(newext) - diff --git a/svnwrap/svn_swig_wrapper.py b/svnwrap/svn_swig_wrapper.py --- a/svnwrap/svn_swig_wrapper.py +++ b/svnwrap/svn_swig_wrapper.py @@ -6,7 +6,6 @@ import sys import tempfile import urlparse import urllib -import hashlib import collections import warnings diff --git a/svnwrap/tests/test_svnwrap.py b/svnwrap/tests/test_svnwrap.py --- a/svnwrap/tests/test_svnwrap.py +++ b/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)