/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/uncommit.py

  • Committer: Breezy landing bot
  • Author(s): Colin Watson
  • Date: 2020-11-16 21:47:08 UTC
  • mfrom: (7521.1.1 remove-lp-workaround)
  • Revision ID: breezy.the.bot@gmail.com-20201116214708-jos209mgxi41oy15
Remove breezy.git workaround for bazaar.launchpad.net.

Merged from https://code.launchpad.net/~cjwatson/brz/remove-lp-workaround/+merge/393710

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
 
from bzrlib import (
 
21
from . import (
24
22
    errors,
25
23
    revision as _mod_revision,
26
24
    )
27
 
from bzrlib.branch import Branch
28
 
from bzrlib.errors import BoundBranchOutOfDate
 
25
from .branch import Branch
 
26
from .errors import BoundBranchOutOfDate
29
27
 
30
28
 
31
29
def remove_tags(branch, graph, old_tip, parents):
40
38
    reverse_tags = branch.tags.get_reverse_tag_dict()
41
39
    ancestors = graph.find_unique_ancestors(old_tip, parents)
42
40
    removed_tags = []
43
 
    for revid, tags in reverse_tags.iteritems():
44
 
        if not revid in ancestors:
 
41
    for revid, tags in reverse_tags.items():
 
42
        if revid not in ancestors:
45
43
            continue
46
44
        for tag in tags:
47
45
            branch.tags.delete_tag(tag)
99
97
                new_revision_id = rev_id
100
98
                break
101
99
            if verbose:
102
 
                print 'Removing revno %d: %s' % (cur_revno, rev_id)
 
100
                print('Removing revno %d: %s' % (cur_revno, rev_id))
103
101
            cur_revno -= 1
104
102
            parents = graph.get_parent_map([rev_id]).get(rev_id, None)
105
103
            if not parents: