[PATCH 4 of 7] histedit: replaces `create`, `replaced`, `tmpnodes` lists with replacement graph

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Oct 1 16:55:34 CDT 2012


On 1 oct. 2012, at 20:41, Augie Fackler wrote:

> 
> On Sep 27, 2012, at 6:07 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
> 
>> Note:
>> 
>>   This changes allows a more accurate bookmark movement. bookmark on dropped
>>   changeset are now move of their parent (or replacement of their parent)
>>   instead of their children.
> 
> reference the issue?

There is not issue for that in the tracker. (I discovered that while working on this) Should I put one ?

>> diff --git a/hgext/histedit.py b/hgext/histedit.py
>> --- a/hgext/histedit.py
>> +++ b/hgext/histedit.py
>> @@ -272,7 +272,7 @@
>> 
>> +        (parentctx, replacement_) = actfunc(ui, repo, parentctx, ha, opts)
>> +        replacements.extend(replacement_)
>> 
>>    hg.update(repo, parentctx.node())
>> 
>> +    mapping, tmpnodes, __ = processreplacement(repo, replacements)
> 
> What's the __ here?

The list of created nodes. Its not used here.
It's only used in the --abort case.

> 
>> +    if mapping:
>> +        for prec, succs in mapping.iteritems():
>> +            if not succs:
>> +                ui.debug('histedit: %s is dropped\n' % node.short(prec))
>> +            else:
> 
> 
> 
> 
>> -def writestate(repo, parentctxnode, created, replaced,
>> -               tmpnodes, existing, rules, keep, topmost, replacemap):
>> +def writestate(repo, parentnode, rules, keep, topmost, replacements):
>>    fp = open(os.path.join(repo.path, 'histedit-state'), 'w')
>> -    pickle.dump((parentctxnode, created, replaced,
>> -                 tmpnodes, existing, rules, keep, topmost, replacemap),
>> -                fp)
>> +    pickle.dump((parentnode, rules, keep, topmost, replacements), fp)
> 
> If we're updating the format, can we stop using pickle?

Probably. But that's outside the scope of that series in my opinion.


>>  $ hg histedit 1 --commands commands.txt --verbose | grep histedit
>> -  histedit: Should update metadata for the following changes:
>> -  histedit:  0efacef7cb48 to 1be9c35b4cb2
>> -  histedit:     moving bookmarks five
>> -  histedit:  0efacef7cb48 to 7c044e3e33a9
>> -  histedit:  ae467701c500 to 1be9c35b4cb2
>> -  histedit:     moving bookmarks four, three
>> +  histedit: moving bookmarks three to 1be9c35b4cb2
>> +  histedit: moving bookmarks four to 1be9c35b4cb2
>> +  histedit: moving bookmarks five to 7c044e3e33a9
> 
> can you record "moving bookmarks $mark from $old to $new"? That feels like a better debug statement.

Yes. I'll do that.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list