[PATCH] contrib/synthrepo: return None to delete files on commit, don't raise IOError

Mike Edgar adgar at google.com
Mon Sep 15 15:11:56 CDT 2014


# HG changeset patch
# User Mike Edgar <adgar at google.com>
# Date 1410811674 14400
#      Mon Sep 15 16:07:54 2014 -0400
# Node ID eb3f7a03d0955f61984702e00fb3f9ae9107a7cd
# Parent  ca854cd4a26a8770fbc22b4d7ee1ac6823b682a5
contrib/synthrepo: return None to delete files on commit, don't raise IOError

The internal commit API was changed in 650b5b6e75ed to expect None from the
filectx function when a file is to be deleted, not an IOError. This change
keeps synthrepo up-to-date.

diff -r ca854cd4a26a -r eb3f7a03d095 contrib/synthrepo.py
--- a/contrib/synthrepo.py	Tue Aug 19 14:33:31 2014 -0400
+++ b/contrib/synthrepo.py	Mon Sep 15 16:07:54 2014 -0400
@@ -356,10 +356,7 @@
                              for __ in xrange(pick(linesinfilesadded))) + '\n'
             changes[path] = context.memfilectx(repo, path, data)
         def filectxfn(repo, memctx, path):
-            data = changes[path]
-            if data is None:
-                raise IOError
-            return data
+            return changes[path]
         if not changes:
             continue
         if revs:


More information about the Mercurial-devel mailing list