370
def _set_name_versions(self):
371
"""Pass over inventory and mark new entry version as needed.
370
def _set_revisions(self):
371
"""Pass over inventory and mark new revisions as needed.
373
Files get a new name version when they are new, have a
374
different parent, or a different name from in the
375
basis inventory, or if the file is in a different place
376
to any of the parents."""
373
Entries get a new revision when they are modified in
374
any way, which includes a merge with a new set of
375
parents that have the same entry. Currently we do not
376
check for that set being ancestors of each other - and
377
we should - only parallel children should count for this
378
test. I.e. if we are merging in revision FOO, and our
379
copy of file id BAR is identical to FOO.BAR, we should
380
generate a new revision of BAR IF and only IF FOO is
381
neither a child of our current tip, nor an ancestor of
382
our tip. The presence of FOO in our store should not
383
affect this logic UNLESS we are doing a merge of FOO,
377
386
# XXX: Need to think more here about when the user has
378
387
# made a specific decision on a particular value -- c.f.
388
397
previous_ie = previous_inv[file_id]
389
398
if ie.compatible_for_commit(previous_ie):
390
399
mutter("found compatible previous entry")
391
compatible_priors.add(previous_ie.name_version)
400
compatible_priors.add(previous_ie.revision)
392
401
if len(compatible_priors) != 1:
393
mutter('new name_version for {%s}', file_id)
394
ie.name_version = self.rev_id
402
mutter('new revision for {%s}', file_id)
403
ie.revision = self.rev_id
396
ie.name_version = compatible_priors.pop()
397
mutter('name_version for {%s} inherited as {%s}',
398
file_id, ie.name_version)
405
ie.revision = compatible_priors.pop()
406
mutter('revision for {%s} inherited as {%s}',
407
file_id, ie.revision)
400
409
def _store_entries(self):
401
410
"""Build revision inventory and store modified files.