# HG changeset patch # User Augie Fackler # Date 1334784059 18000 # Node ID cfee8d1eff8878961f6700aa02c5a717eb6d32d2 # Parent 2a034bd52d1449cd5a90e766a994dd56e1f866bd# Parent 5e1323a186fdf3a56f051c59a4ca633188fd5de1 Merge diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- a/hgsubversion/svncommands.py +++ b/hgsubversion/svncommands.py @@ -59,7 +59,11 @@ def verify(ui, repo, args=None, **opts): if branchpath: fp = branchpath + '/' + fn data, mode = svn.get_file(posixpath.normpath(fp), srev) - fctx = ctx[fn] + try: + fctx = ctx[fn] + except error.LookupError: + result = 1 + continue dmatch = fctx.data() == data mmatch = fctx.flags() == mode if not (dmatch and mmatch): diff --git a/hgsubversion/svnmeta.py b/hgsubversion/svnmeta.py --- a/hgsubversion/svnmeta.py +++ b/hgsubversion/svnmeta.py @@ -13,21 +13,15 @@ import maps import editor -def pickle_atomic(data, file_path, dir=None): +def pickle_atomic(data, file_path): """pickle some data to a path atomically. This is present because I kept corrupting my revmap by managing to hit ^C during the pickle of that file. """ - try: - f, path = tempfile.mkstemp(prefix='pickling', dir=dir) - f = os.fdopen(f, 'w') - pickle.dump(data, f) - f.close() - except: # pragma: no cover - raise - else: - hgutil.rename(path, file_path) + f = hgutil.atomictempfile(file_path, createmode=0644) + pickle.dump(data, f) + f.close() class SVNMeta(object): @@ -77,8 +71,7 @@ class SVNMeta(object): self.repo.ui.setconfig('hgsubversion', 'layout', self._layout) else: self._layout = None - pickle_atomic(self.tag_locations, self.tag_locations_file, - self.meta_data_dir) + pickle_atomic(self.tag_locations, self.tag_locations_file) # ensure nested paths are handled properly self.tag_locations.sort() self.tag_locations.reverse() @@ -225,7 +218,7 @@ class SVNMeta(object): '''Save the Subversion metadata. This should really be called after every revision is created. ''' - pickle_atomic(self.branches, self.branch_info_file, self.meta_data_dir) + pickle_atomic(self.branches, self.branch_info_file) def localname(self, path): """Compute the local name for a branch located at path. diff --git a/tests/test_push_command.py b/tests/test_push_command.py --- a/tests/test_push_command.py +++ b/tests/test_push_command.py @@ -3,6 +3,7 @@ import test_util import atexit import errno import os +import sys import random import shutil import socket @@ -133,8 +134,10 @@ class PushTests(test_util.TestBase): self.assertNotEqual('an_author', tip.user()) self.assertEqual('(no author)', tip.user().rsplit('@', 1)[0]) finally: - # TODO: use svnserve.kill() in Python >2.5 - test_util.kill_process(svnserve) + if sys.version_info >= (2,6): + svnserve.kill() + else: + test_util.kill_process(svnserve) def test_push_over_svnserve(self): self.internal_push_over_svnserve()