Rev 3420: Ian's review feedback in http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/submitted
John Arbash Meinel
john at arbash-meinel.com
Mon May 5 21:29:21 BST 2008
At http://bzr.arbash-meinel.com/branches/bzr/1.4-dev/submitted
------------------------------------------------------------
revno: 3420
revision-id: john at arbash-meinel.com-20080505202906-0utn8d1ti6458rea
parent: john at arbash-meinel.com-20080501204100-r9pw4d1znr8g728x
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: submitted
timestamp: Mon 2008-05-05 15:29:06 -0500
message:
Ian's review feedback
modified:
bzrlib/status.py status.py-20050505062338-431bfa63ec9b19e6
bzrlib/tests/test_graph.py test_graph_walker.py-20070525030405-enq4r60hhi9xrujc-1
-------------- next part --------------
=== modified file 'bzrlib/status.py'
--- a/bzrlib/status.py 2008-05-01 20:41:00 +0000
+++ b/bzrlib/status.py 2008-05-05 20:29:06 +0000
@@ -157,7 +157,7 @@
:param revision_ids: A set of revision_ids
:param parent_map: The parent information for each node. Revisions which
are considered ghosts should not be present in the map.
- :return: An the iterator from MergeSorter.iter_topo_order()
+ :return: iterator from MergeSorter.iter_topo_order()
"""
# MergeSorter requires that all nodes be present in the graph, so get rid
# of any references pointing outside of this graph.
@@ -175,6 +175,10 @@
def show_pending_merges(new, to_file, short=False):
"""Write out a display of pending merges in a working tree."""
+ parents = new.get_parent_ids()
+ if len(parents) < 2:
+ return
+
# we need one extra space for terminals that wrap on last char
term_width = osutils.terminal_width() - 1
if short:
@@ -184,15 +188,11 @@
first_prefix = ' '
sub_prefix = ' '
- parents = new.get_parent_ids()
- if len(parents) < 2:
- return
pending = parents[1:]
branch = new.branch
last_revision = parents[0]
if not short:
to_file.write('pending merges:\n')
- ignore = set([None, last_revision, _mod_revision.NULL_REVISION])
graph = branch.repository.get_graph()
other_revisions = [last_revision]
log_formatter = log.LineLogFormatter(to_file)
@@ -239,8 +239,6 @@
raise AssertionError('Somehow we misunderstood how'
' iter_topo_order works %s != %s' % (first, merge))
for num, sub_merge, depth, eom in rev_id_iterator:
- if sub_merge in ignore:
- continue
rev = revisions[sub_merge]
if rev is None:
to_file.write(sub_prefix + '(ghost) ' + sub_merge + '\n')
=== modified file 'bzrlib/tests/test_graph.py'
--- a/bzrlib/tests/test_graph.py 2008-04-30 22:18:14 +0000
+++ b/bzrlib/tests/test_graph.py 2008-05-05 20:29:06 +0000
@@ -234,12 +234,10 @@
# |/|/
# t u
complex_shortcut2 = {'a':[NULL_REVISION], 'b':['a'], 'c':['b'], 'd':['c'],
- 'e':['d'], 'f':['e'],
- 'g':['f'], 'h':['d'], 'k':['h', 'i'], 'j':['h'],
- 'i':['g'], 'l':['k'], 'm':['l'],
- 'n':['m'], 't':['i', 's'], 'u':['s', 'j'],
- 'o':['n'], 'p':['o'], 'q':['p'],
- 'r':['q'], 's':['r'],
+ 'e':['d'], 'f':['e'], 'g':['f'], 'h':['d'], 'i':['g'],
+ 'j':['h'], 'k':['h', 'i'], 'l':['k'], 'm':['l'], 'n':['m'],
+ 'o':['n'], 'p':['o'], 'q':['p'], 'r':['q'], 's':['r'],
+ 't':['i', 's'], 'u':['s', 'j'],
}
# Graph where different walkers will race to find the common and uncommon
@@ -410,10 +408,6 @@
self.calls.extend(nodes)
return self._real_parents_provider.get_parent_map(nodes)
- def get_parent_map(self, nodes):
- self.calls.extend(nodes)
- return self._real_parents_provider.get_parent_map(nodes)
-
class TestGraph(TestCaseWithMemoryTransport):
@@ -1230,7 +1224,6 @@
graph = self.make_graph(racing_shortcuts)
self.assertFindUniqueAncestors(graph,
['p', 'q', 'z'], 'z', ['y'])
- import pdb; pdb.set_trace()
self.assertFindUniqueAncestors(graph,
['h', 'i', 'j', 'y'], 'j', ['z'])
More information about the bazaar-commits
mailing list