263
263
>>> result_path = os.path.join(q, "result")
264
264
>>> commit_test_revisions()
265
265
>>> version = pybaz.Version("test@example.com/test--test--0.1")
266
>>> import_version('/', version, fancy=False, dry_run=True)
266
>>> def printer(message): print message
267
>>> import_version('/', version, printer, fancy=False, dry_run=True)
267
268
Traceback (most recent call last):
268
269
UserError: / exists, but is not a bzr branch.
269
>>> import_version(result_path, version, fancy=False, dry_run=True)
270
>>> import_version(result_path, version, printer, fancy=False, dry_run=True)
270
271
Traceback (most recent call last):
271
272
UserError: The version test@example.com/test--test--0.1 does not exist.
272
273
>>> version = pybaz.Version("test@example.com/test--test--0")
273
>>> import_version(result_path, version, fancy=False, dry_run=True)
274
>>> import_version(result_path, version, printer, fancy=False, dry_run=True)
276
277
Dry run, not modifying output_dir
278
>>> import_version(result_path, version, fancy=False)
279
>>> import_version(result_path, version, printer, fancy=False)
283
>>> import_version(result_path, version, fancy=False)
284
>>> import_version(result_path, version, printer, fancy=False)
284
285
Tree is up-to-date with test@example.com/test--test--0--patch-2
285
286
>>> commit_more_test_revisions()
286
>>> import_version(result_path, version, fancy=False)
287
>>> import_version(result_path, version, printer, fancy=False)
431
433
yield Progress("revisions", i, len(ancestors))
432
434
if revdir is None:
433
435
revdir = os.path.join(tempdir, "rd")
434
baz_inv, log = get_revision(revdir, revision)
437
baz_inv, log = get_revision(revdir, revision)
438
except pybaz.errors.ExecProblem, e:
439
if ("%s" % e.args).find('could not connect') == -1:
441
missing_ancestor = revision
443
print ("unable to access ancestor %s, making into a merge."
435
446
# cached so we can delete the log
436
447
log_date = log.date
437
448
log_summary = log.summary
464
475
rev_id = revision_id(revision)
465
476
branch.lock_write()
479
# if we want it to be in revision-history, do that here.
480
branch.add_pending_merge(revision_id(missing_ancestor))
481
missing_ancestor = None
467
482
for merge in direct_merges:
468
483
branch.add_pending_merge(revision_id(merge.revision))
469
484
branch.set_inventory(baz_inv)