Greg Stein wrote:
> On Tue, Oct 22, 2002 at 10:20:27PM +0200, Marko Macek wrote:
>
>>...
>>+ def has_file(self, fname):
>>+ for f, r in self.changes:
>>+ if f == fname:
>>+ return 1
>>+ for f, r in self.deletes:
>>+ if f == fname:
>>+ return 1
>>+ return 0
>
>
> Ah! That is good... I noticed a couple times where somebody was committing
> with an empty message (same author, no message... same id), that it would
> attempt to add/modify/delete a file multiple times. Not good :-)
...
> I don't think that will work. It is possible to have interleaved commits.
> For example, the sorted revs file could contain:
...
> Just because you hit an interleaved commit (id-B) doesn't mean that you
> should immediately process id-A.
Yes, I realized that later.
> Also, note that c.has_file(fname) is not necessarily a proper condition for
> processing a commit either. In the above example, it is possible that id-A
> changes a file in the first two lines, and then id-B deletes the file (but
> id-A is not complete).
Hmm. It seems unlikely that two "overlapping" commits could work on the
same file (except maybe on different branches). I believe CVS will not
allow a commit if the file is not up-to-date.
> That said, if you're about to put a file into a Commit object and it is
> *already* present, then you want to close out that commit first. This
> scenario will happen when somebody commits using the same message in rapid
> succession. It is still possible that the commits were interleaved, but
> since the commit message is the same, then we just have to break them up,
Yes. The way we currently lose revisions during conversion is bad (plus
it breaks my tagging/branching code).
> even though that may not reflect what *really* happened. I would state that
> we should issue a warning so that a human can investigate. Ideally, we could
> provide controls so that a human could separate an interleaved commit from
> the same user/message.
For now, I will remove the last condition in this part of the patch:
>> # scan for commits to process
>> process = [ ]
>> - for id, c in commits.items():
>> - if c.t_max + COMMIT_THRESHOLD < timestamp:
>> + for xid, c in commits.items():
>> + if c.t_max + COMMIT_THRESHOLD < timestamp or \
>> + c.has_file(fname) or \
>> + xid != id:
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 23 07:08:19 2002