changeset 857:cfee8d1eff88

Merge
author Augie Fackler <raf@durin42.com>
date Wed, 18 Apr 2012 16:20:59 -0500
parents 2a034bd52d14 (diff) 5e1323a186fd (current diff)
children bb6a013abaed
files hgsubversion/svncommands.py
diffstat 3 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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):
--- 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.
--- 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()