~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tsort.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-05 04:05:05 UTC
  • mfrom: (3473.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080605040505-i9kqxg2fps2qjdi0
Add the 'alias' command (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
351
351
            if parent is None:
352
352
                # end of mainline_revisions history
353
353
                continue
354
 
            graph_parent_ids = self._graph[revision]
355
 
            if not graph_parent_ids:
356
 
                # We ran into a ghost, skip over it, this is a workaround for
357
 
                # bug #243536, the _graph has had ghosts stripped, but the
358
 
                # mainline_revisions have not
359
 
                continue
360
 
            if graph_parent_ids[0] == parent:
 
354
            if self._graph[revision][0] == parent:
361
355
                continue
362
356
            # remove it from its prior spot
363
357
            self._graph[revision].remove(parent)
516
510
                    revno = parent_revno[:-1] + (parent_revno[-1] + 1,)
517
511
            else:
518
512
                # no parents, use the root sequence
519
 
                root_count = revno_to_branch_count.get(0, -1)
520
 
                root_count += 1
 
513
                root_count = revno_to_branch_count.get(0, 0)
521
514
                if root_count:
522
515
                    revno = (0, root_count, 1)
523
516
                else:
524
517
                    revno = (1,)
 
518
                root_count += 1
525
519
                revno_to_branch_count[0] = root_count
526
520
 
527
521
            # store the revno for this node for future reference