1537
1537
def make_branch_with_alternate_ancestries(self, relpath='.'):
1538
1538
# See test_merge_sorted_exclude_ancestry below for the difference with
1539
1539
# bt.per_branch.test_iter_merge_sorted_revision.
1540
# TestIterMergeSortedRevisionsBushyGraph.
1540
# TestIterMergeSortedRevisionsBushyGraph.
1541
1541
# make_branch_with_alternate_ancestries
1542
1542
# and test_merge_sorted_exclude_ancestry
1543
1543
# See the FIXME in assertLogRevnos too.
1598
1598
b, '1', '3', exclude_common_ancestry=True,
1599
1599
generate_merge_revisions=True)
1602
class TestLogDefaults(TestCaseForLogFormatter):
1603
def test_default_log_level(self):
1604
#wt = self.make_standard_commit('test_default_log_level')
1605
wt = self._prepare_tree_with_merges()
1608
class CustomLogFormatter(log.LogFormatter):
1609
def __init__(self, *args, **kwargs):
1610
super(CustomLogFormatter, self).__init__(*args, **kwargs)
1612
def get_levels(self):
1613
# log formatter supports all levels:
1615
def log_revision(self, revision):
1616
self.revisions.append(revision)
1618
log_formatter = LogCatcher()
1619
# First request we don't specify number of levels, we should get a
1620
# sensible default (whatever the LogFormatter handles - which in this
1621
# case is 0/everything):
1622
request = log.make_log_request_dict(limit=10)
1623
log.Logger(b, request).show(log_formatter)
1624
# should have all three revisions:
1625
self.assert_(len(log_formatter.revisions) == 3)
1628
log_formatter = LogCatcher()
1629
# now explicitly request mainline revisions only:
1630
request = log.make_log_request_dict(limit=10, levels=1)
1631
log.Logger(b, request).show(log_formatter)
1632
# should now only have 2 revisions:
1633
self.assert_(len(log_formatter.revisions) == 2)