~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/uncommit.py

  • Committer: Jelmer Vernooij
  • Date: 2011-11-27 17:42:25 UTC
  • mto: This revision was merged to the branch mainline in revision 6311.
  • Revision ID: jelmer@samba.org-20111127174225-tspfeewl0gwxxumt
Add possible_transports in a couple more places.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Remove the last revision from the history of the current branch."""
18
18
 
19
 
from __future__ import absolute_import
20
 
 
21
19
# TODO: make the guts of this methods on tree, branch.
22
20
 
23
21
from bzrlib import (
28
26
from bzrlib.errors import BoundBranchOutOfDate
29
27
 
30
28
 
31
 
def remove_tags(branch, graph, old_tip, parents):
 
29
def remove_tags(branch, graph, old_tip, new_tip):
32
30
    """Remove tags on revisions between old_tip and new_tip.
33
31
 
34
32
    :param branch: Branch to remove tags from
35
33
    :param graph: Graph object for branch repository
36
34
    :param old_tip: Old branch tip
37
 
    :param parents: New parents
 
35
    :param new_tip: New branch tip
38
36
    :return: Names of the removed tags
39
37
    """
40
38
    reverse_tags = branch.tags.get_reverse_tag_dict()
41
 
    ancestors = graph.find_unique_ancestors(old_tip, parents)
 
39
    ancestors = graph.find_unique_ancestors(old_tip, [new_tip])
42
40
    removed_tags = []
43
41
    for revid, tags in reverse_tags.iteritems():
44
42
        if not revid in ancestors:
130
128
                    hook_new_tip = None
131
129
                hook(hook_local, hook_master, old_revno, old_tip, new_revno,
132
130
                     hook_new_tip)
133
 
            if not _mod_revision.is_null(new_revision_id):
134
 
                parents = [new_revision_id]
135
 
            else:
136
 
                parents = []
 
131
            if branch.supports_tags() and not keep_tags:
 
132
                remove_tags(branch, graph, old_tip, new_revision_id)
137
133
            if tree is not None:
 
134
                if not _mod_revision.is_null(new_revision_id):
 
135
                    parents = [new_revision_id]
 
136
                else:
 
137
                    parents = []
138
138
                parents.extend(reversed(pending_merges))
139
139
                tree.set_parent_ids(parents)
140
 
            if branch.supports_tags() and not keep_tags:
141
 
                remove_tags(branch, graph, old_tip, parents)
142
140
    finally:
143
141
        for item in reversed(unlockable):
144
142
            item.unlock()