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

login
register
mail settings
Submitter adgar@google.com
Date Sept. 15, 2014, 8:11 p.m.
Message ID <eb3f7a03d0955f619847.1410811916@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/5828/
State Accepted
Headers show

Comments

adgar@google.com - Sept. 15, 2014, 8:11 p.m.
# HG changeset patch
# User Mike Edgar <adgar@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.
Matt Mackall - Sept. 16, 2014, 4:30 p.m.
On Mon, 2014-09-15 at 16:11 -0400, Mike Edgar wrote:
> # HG changeset patch
> # User Mike Edgar <adgar@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

Queued for default, thanks.

Patch

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: