~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/switch.py

  • Committer: Ian Clatworthy
  • Date: 2007-11-22 04:31:28 UTC
  • mto: (3015.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 3016.
  • Revision ID: ian.clatworthy@internode.on.net-20071122043128-bjlhladklqlmfo4d
fix pending merge detection and test

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    """
67
67
    try:
68
68
        tree = control.open_workingtree()
69
 
        # XXX: Should the tree be locked for get_parent_ids?
70
 
        existing_pending_merges = tree.get_parent_ids()[1:]
71
69
    except errors.NotBranchError:
72
 
        # no tree, so can't be any pending merges???
 
70
        # old branch is gone
73
71
        return
 
72
    # XXX: Should the tree be locked for get_parent_ids?
 
73
    existing_pending_merges = tree.get_parent_ids()[1:]
74
74
    if len(existing_pending_merges) > 0:
75
75
        raise errors.BzrCommandError('Pending merges must be '
76
76
            'committed or reverted before using switch.')