~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/uncommit.py

Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
23
 
from bzrlib import (
24
 
    errors,
25
 
    revision as _mod_revision,
26
 
    )
 
23
from bzrlib import revision as _mod_revision
27
24
from bzrlib.branch import Branch
28
25
from bzrlib.errors import BoundBranchOutOfDate
29
26
 
30
27
 
31
 
def uncommit(branch, dry_run=False, verbose=False, revno=None, tree=None,
32
 
             local=False):
 
28
def uncommit(branch, dry_run=False, verbose=False, revno=None, tree=None):
33
29
    """Remove the last revision from the supplied branch.
34
30
 
35
31
    :param dry_run: Don't actually change anything
49
45
        if tree is not None:
50
46
            pending_merges = tree.get_parent_ids()[1:]
51
47
 
52
 
        if local:
53
 
            master = None
54
 
            if branch.get_bound_location() is None:
55
 
                raise errors.LocalRequiresBoundBranch()
56
 
        else:
57
 
            master = branch.get_master_branch()
58
 
            if master is not None:
59
 
                master.lock_write()
60
 
                unlockable.append(master)
 
48
        master = branch.get_master_branch()
 
49
        if master is not None:
 
50
            master.lock_write()
 
51
            unlockable.append(master)
61
52
        rh = branch.revision_history()
62
53
        if master is not None and rh[-1] != master.last_revision():
63
54
            raise BoundBranchOutOfDate(branch, master)