monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Mark merge for existence


From: William Uther
Subject: [Monotone-devel] Mark merge for existence
Date: Thu, 15 Nov 2007 16:24:55 +1100

Hi,

I'm looking at how to get rid of die-die-die merge for files. As noted by others, if we used mark-merge here then we'd be able to un- delete and re-delete, and everything would "just work".

As a first step I'd like to make a version of monotone that remembers the new 'existence' marks when the file exists (i.e. add existence marks to the current code without trying to remember them when a file is deleted - no it wont change anything, but it is a necessary step).

The problem is that there seem to be a couple of different places that marks and rosters are generated / merged and I want to make sure I understand what is going on before I play with things - this is fairly important code. :)

Let's consider the call chain following the "merge" command [I've included only one branch in the call chain where interactive_merge_and_store() calls roster_merge() then store_roster_merge_result()]:

  cmd_merging.cc : CMD(merge)
  cmd_merging.cc : merge_two()
merge.cc : interactive_merge_and_store() # loads the left & right rosters and marks from db roster_merge.cc : roster_merge() merge.cc : store_roster_merge_result() database.cc : database::put_revision() database.cc : put_roster_for_revision() roster.cc : make_roster_for_revision() roster.cc : make_roster_for_merge() roster.cc : mark_merge_roster() # much happens here roster.cc : mark_unmerged_node() and mark_merged_node()

It seems that roster_merge() does the main merge, but then mark_merge_roster() does a lot of very similar work to build up the new marking map just before it is actually written to the db. This seems a little convoluted. Is there some reason for this I'm missing, or is it just... historical?

That means that if I want to add new existence marks, I'd need to add them both in roster_merge() and in mark_merge_roster(). Are there any other places I should look at?

Oh, and I've had to change things like roster.cc:push_marking(). I'd prefer to update some database format ID so that I don't get my db's all confused while working on different versions of MTN. Where would I find that in the code?

Cheers,

Will        :-}





reply via email to

[Prev in Thread] Current Thread [Next in Thread]