changeset 325:4f4db3d2fdbb

2.4 compat fixes.
author Augie Fackler <durin42@gmail.com>
date Mon, 18 May 2009 17:09:26 -0500
parents c4061e57974c
children 13998e698d3e
files hg_delta_editor.py svnexternals.py svnwrap/svn_swig_wrapper.py svnwrap/tests/test_svnwrap.py
diffstat 4 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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)
 
--- 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)
-
--- 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
--- 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)