~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to baz2bzr

  • Committer: abentley
  • Date: 2005-04-30 06:45:03 UTC
  • Revision ID: abentley@lappy-20050430064503-52eef3dfac9f9145
Used replay to get next revision

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
            old = os.path.join(revdir, ".bzr")
196
196
            new = os.path.join(tempdir, ".bzr")
197
197
            os.rename(old, new)
198
 
            shutil.rmtree(revdir)
199
 
            baz_inv, log = get_revision(revdir, revision)
 
198
            baz_inv, log = apply_revision(revdir, revision)
200
199
            os.rename(new, old)
201
200
            branch = bzrlib.Branch(revdir)
202
201
        branch.set_inventory(baz_inv)
219
218
    log = tree.iter_logs(reverse=True).next()
220
219
    return bzr_inventory_data(tree), log 
221
220
 
 
221
def apply_revision(revdir, revision):
 
222
    tree = pybaz.tree_root(revdir)
 
223
    revision.apply(tree)
 
224
    log = tree.iter_logs(reverse=True).next()
 
225
    return bzr_inventory_data(tree), log 
 
226
 
 
227
 
222
228
def bzr_inventory_data(tree):
223
229
    inv_iter = tree.iter_inventory_ids(source=True, both=True)
224
230
    inv_map = {}