~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/revision.py

  • Committer: John Arbash Meinel
  • Date: 2007-04-10 18:30:32 UTC
  • mto: This revision was merged to the branch mainline in revision 2403.
  • Revision ID: john@arbash-meinel.com-20070410183032-rw4d3kpb8f9cesfw
We don't need to extract ancestry_b until we after we've checked for existence.
It seems to make sense to check 'b in ancestry_a' first, though we might consider checking
a in ancestry_b first.
b in a is merging something which has already been merged.
a in b is merging something which has merged you.
And 'a in b' may actually be more common.
The timing difference is fairly small, though.

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
            # Shortcut the case where one of the tips is already included in
255
255
            # the other graphs ancestry.
256
256
            ancestry_a = graph.get_ancestry(revision_a)
257
 
            ancestry_b = graph.get_ancestry(revision_b)
258
257
            if revision_b in ancestry_a:
259
258
                return revision_b
 
259
            ancestry_b = graph.get_ancestry(revision_b)
260
260
            if revision_a in ancestry_b:
261
261
                return revision_a
262
262
            # convert to a NULL_REVISION based graph.