[PATCH 5 of 6 v2] largefiles: wrap commitworkingctx() instead of commitctx()
Dan Villiom Podlaski Christiansen
danchr at gmail.com
Sun Jan 8 13:37:55 UTC 2012
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1326029623 -3600
# Node ID 9ef9b0ecd653e9c1eedb75ec5a9cfe05b38eb939
# Parent 90946a153534f53366adb3002321479e1b344b98
largefiles: wrap commitworkingctx() instead of commitctx()
This ensures that largefiles will not break or otherwise interfere
with conversion extensions. In order to ensure that other extensions
do not interfere with an lfconvert, we continue to call commitctx()
directly from _addchangeset() & _lfconvert_addchangeset(), and update
the largefiles cache manually.
diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py
+++ b/hgext/largefiles/lfcommands.py
@@ -188,6 +188,7 @@ def _addchangeset(ui, rsrc, rdst, ctx, r
mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
getfilectx, ctx.user(), ctx.date(), ctx.extra())
ret = rdst.commitctx(mctx)
+ lfutil.copyalltostore(rdst, ret)
rdst.dirstate.setparents(ret)
revmap[ctx.node()] = rdst.changelog.tip()
@@ -304,6 +305,7 @@ def _lfconvert_addchangeset(rsrc, rdst,
mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
getfilectx, ctx.user(), ctx.date(), ctx.extra())
ret = rdst.commitctx(mctx)
+ lfutil.copyalltostore(rdst, ret)
rdst.dirstate.setparents(ret)
revmap[ctx.node()] = rdst.changelog.tip()
diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -24,7 +24,7 @@ def reposetup(ui, repo):
if not repo.local():
return proto.wirereposetup(ui, repo)
- for name in ('status', 'commitctx', 'commit', 'push'):
+ for name in ('status', 'commitworkingctx', 'commit', 'push'):
method = getattr(repo, name)
if (isinstance(method, types.FunctionType) and
method.func_name == 'wrap'):
@@ -258,8 +258,8 @@ def reposetup(ui, repo):
# As part of committing, copy all of the largefiles into the
# cache.
- def commitctx(self, *args, **kwargs):
- node = super(lfiles_repo, self).commitctx(*args, **kwargs)
+ def commitworkingctx(self, *args, **kwargs):
+ node = super(lfiles_repo, self).commitworkingctx(*args, **kwargs)
lfutil.copyalltostore(self, node)
return node
More information about the Mercurial-devel
mailing list