~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/uncommit.py

Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        branch.lock_write()
44
44
        unlockable.append(branch)
45
45
 
 
46
        pending_merges = []
 
47
 
46
48
        master = branch.get_master_branch()
47
49
        if master is not None:
48
50
            master.lock_write()
56
58
        files_to_remove = []
57
59
        for r in range(revno-1, len(rh)):
58
60
            rev_id = rh.pop()
 
61
            rev = branch.repository.get_revision(rev_id)
 
62
            # When we finish popping off the pending merges, we want
 
63
            # them to stay in the order that they used to be.
 
64
            # but we pop from the end, so reverse the order, and
 
65
            # then get the order right at the end
 
66
            pending_merges.extend(reversed(rev.parent_ids[1:]))
59
67
            if verbose:
60
68
                print 'Removing revno %d: %s' % (len(rh)+1, rev_id)
61
69
 
68
76
            branch.set_revision_history(rh)
69
77
            if tree is not None:
70
78
                tree.set_last_revision(branch.last_revision())
 
79
                pending_merges.reverse()
 
80
                tree.set_pending_merges(pending_merges)
71
81
    finally:
72
82
        for item in reversed(unlockable):
73
83
            item.unlock()