266
266
A negative number will count from the end of the branch (-1 is the
267
267
last revision, -2 the previous one). If the negative number is larger
268
268
than the branch's history, the first revision is returned.
270
271
revno:1 -> return the first revision
271
272
revno:3:/path/to/branch -> return the 3rd revision of
272
273
the branch '/path/to/branch'
370
371
Supply a specific revision id, that can be used to specify any
371
372
revision id in the ancestry of the branch.
372
373
Including merges, and pending merges.
374
376
revid:aaaa@bbbb-123456789 -> Select revision 'aaaa@bbbb-123456789'
376
378
prefix = 'revid:'
393
395
Supply a positive number to get the nth revision from the end.
394
396
This is the same as supplying negative numbers to the 'revno:' spec.
396
399
last:1 -> return the last revision
397
400
last:3 -> return the revision 2 before the end.
433
436
This is mostly useful when inspecting revisions that are not in the
434
437
revision history of a branch.
437
441
before:1913 -> Return the parent of revno 1913 (revno 1912)
438
442
before:revid:aaaa@bbbb-1234567890 -> return the parent of revision
439
443
aaaa@bbbb-1234567890
521
525
Matches the first entry after a given date (either at midnight or
522
526
at a specified time).
524
One way to display all the changes since yesterday would be:
528
One way to display all the changes since yesterday would be::
525
530
bzr log -r date:yesterday..-1
528
534
date:yesterday -> select the first revision since yesterday
529
535
date:2006-08-14,17:10:14 -> select the first revision after
530
536
August 14th, 2006 at 5:10pm.
632
639
for r, b in ((revision_a, branch), (revision_b, other_branch)):
633
640
if r in (None, revision.NULL_REVISION):
634
641
raise errors.NoCommits(b)
635
revision_source = revision.MultipleRevisionSources(
636
branch.repository, other_branch.repository)
637
rev_id = revision.common_ancestor(revision_a, revision_b,
643
other_branch.lock_read()
640
revno = branch.revision_id_to_revno(rev_id)
641
except errors.NoSuchRevision:
643
return RevisionInfo(branch, revno, rev_id)
645
revision_source = revision.MultipleRevisionSources(
646
branch.repository, other_branch.repository)
647
graph = branch.repository.get_graph(other_branch.repository)
648
revision_a = revision.ensure_null(revision_a)
649
revision_b = revision.ensure_null(revision_b)
650
if revision.NULL_REVISION in (revision_a, revision_b):
651
rev_id = revision.NULL_REVISION
653
rev_id = graph.find_unique_lca(revision_a, revision_b)
654
if rev_id == revision.NULL_REVISION:
655
raise errors.NoCommonAncestor(revision_a, revision_b)
657
revno = branch.revision_id_to_revno(rev_id)
658
except errors.NoSuchRevision:
660
return RevisionInfo(branch, revno, rev_id)
663
other_branch.unlock()
646
666
SPEC_TYPES.append(RevisionSpec_ancestor)