~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/uncommit.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-13 18:38:58 UTC
  • mfrom: (1863 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1869.
  • Revision ID: john@arbash-meinel.com-20060713183858-ebf4aa1f9ef8bb6e
[merge] bzr.dev 1863

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()