/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 bzrlib/uncommit.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

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