/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 upgrade.py

  • Committer: Jelmer Vernooij
  • Date: 2009-03-19 16:43:56 UTC
  • mto: (0.436.139 foreign)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20090319164356-iwxw3x3ntre7fjxc
Fix formatting.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
"""Upgrading revisions made with older versions of the mapping."""
17
17
 
18
 
from bzrlib import ui
 
18
from bzrlib import (
 
19
    trace,
 
20
    ui,
 
21
    )
19
22
from bzrlib.errors import (
20
23
    DependencyNotPresent,
21
24
    BzrError,
22
25
    InvalidRevisionId,
23
26
    NoSuchRevision,
24
27
    )
25
 
from bzrlib.trace import info
26
28
 
27
29
import itertools
28
30
 
145
147
 
146
148
 
147
149
def upgrade_tags(tags, repository, foreign_repository, new_mapping, 
148
 
                 allow_changes=False, verbose=False, branch_renames=None):
 
150
                 allow_changes=False, verbose=False, branch_renames=None,
 
151
                 branch_ancestry=None):
149
152
    """Upgrade a tags dictionary."""
150
153
    renames = {}
151
154
    if branch_renames is not None:
159
162
                renames.update(upgrade_repository(repository, foreign_repository, 
160
163
                      revision_id=revid, new_mapping=new_mapping,
161
164
                      allow_changes=allow_changes, verbose=verbose))
162
 
            if revid in renames:
 
165
            if revid in renames and (branch_ancestry is None or not revid in branch_ancestry):
163
166
                tags.set_tag(name, renames[revid])
164
167
    finally:
165
168
        pb.finished()
178
181
    renames = upgrade_repository(branch.repository, foreign_repository, 
179
182
              revision_id=revid, new_mapping=new_mapping,
180
183
              allow_changes=allow_changes, verbose=verbose)
 
184
    if revid in renames:
 
185
        branch.generate_revision_history(renames[revid])
 
186
    ancestry = branch.repository.get_ancestry(branch.last_revision(), topo_sorted=False)
181
187
    upgrade_tags(branch.tags, branch.repository, foreign_repository, 
182
188
           new_mapping=new_mapping, 
183
 
           allow_changes=allow_changes, verbose=verbose, branch_renames=renames)
184
 
    if revid in renames:
185
 
        branch.generate_revision_history(renames[revid])
 
189
           allow_changes=allow_changes, verbose=verbose, branch_renames=renames,
 
190
           branch_ancestry=ancestry)
186
191
    return renames
187
192
 
188
193
 
322
327
                                                    allow_changes=allow_changes)
323
328
        if verbose:
324
329
            for revid in rebase_todo(repository, plan):
325
 
                info("%s -> %s" % (revid, plan[revid][0]))
 
330
                trace.info("%s -> %s" % (revid, plan[revid][0]))
326
331
        rebase(repository, plan, replay_snapshot)
327
332
        return revid_renames
328
333
    finally: