[PATCH 2 of 4] keyword: don't delete possible wrappers for commictx() (see issue2254)

Christian Ebert blacktrash at gmx.net
Tue Jul 20 04:44:22 CDT 2010


* Augie Fackler on Sunday, July 18, 2010 at 09:17:10 -0500
> On Jul 17, 2010, at 7:01 AM, Christian Ebert wrote:
>> * Dan Villiom Podlaski Christiansen on Friday, July 16, 2010 at
>> 10:41:28 +0200
>>> We were originally made aware of this shortcoming through the
>>> EOL extension. hgsubversion raises an IOError if the data
>>> callback is called on a deleted file.
>> 
>> That is indeed strange, as eol.py does
>> 
>>      def commitctx(self, ctx, error=False):
>>          for f in sorted(ctx.added() + ctx.modified()):
>>              if not self._eolfile(f):
>>                  continue
>>              data = ctx[f].data()
>> 
>> so in theory it should only call data on added and modified files
>> only.
> 
> Except memctx by default describes all files in the context as
> modified, and there's no reasonable API as yet for marking things as
> deleted such that the various status functions work as you'd expect.
> 
> Detecting a memctx is unlikely to work well either - I'm trying to
> refactor record so that it'll use one of those instead of reverting
> files in the wc, committing, then restoring the wc.

Isn't it a problem with context.memctx then? Because
localrepo.commitctx ("wrapped" by memctx.commit) also does

          for f in sorted(ctx.added() + ctx.modified()):

I always wondered about this when trying in vain to understand
memctx.

c
-- 
\black\trash movie    _C O W B O Y_  _C A N O E_  _C O M A_
                     Ein deutscher Western/A German Western

         --->> http://www.blacktrash.org/underdogma/ccc.php


More information about the Mercurial-devel mailing list