2
2
A plugin for displaying what revisions are in 'other' but not in local.
4
from bzrlib.ui import ui_factory
5
5
def show_missing(br_local, br_remote, verbose=False, quiet=False):
6
6
"""Show the revisions which exist in br_remote, that
7
7
do not exist in br_local.
75
75
show_one_log(revno, rev, delta, verbose, sys.stdout, 'original')
78
def find_unmerged(local_branch, remote_branch):
79
local_branch.lock_read()
81
remote_branch.lock_read()
83
progress = ui_factory.progress_bar()
84
progress.update('local history', 0, 5)
85
local_rev_history = local_branch.revision_history()
86
local_rev_history_map = dict(
87
[(rev, local_rev_history.index(rev))
88
for rev in local_rev_history])
89
progress.update('local ancestry', 1, 5)
90
local_ancestry = set(local_branch.get_ancestry(
91
local_rev_history[-1]))
92
progress.update('remote history', 2, 5)
93
remote_rev_history = remote_branch.revision_history()
94
remote_rev_history_map = dict(
95
[(rev, remote_rev_history.index(rev))
96
for rev in remote_rev_history])
97
progress.update('remote ancestry', 3, 5)
98
remote_ancestry = set(remote_branch.get_ancestry(
99
remote_rev_history[-1]))
100
progress.update('pondering', 4, 5)
103
for elem in local_ancestry.union(remote_ancestry):
104
if ((elem in local_ancestry) and
105
(elem not in remote_ancestry)):
106
if elem in local_rev_history:
107
local_extra.add(elem)
108
elif ((elem not in local_ancestry) and
109
(elem in remote_ancestry)):
110
if elem in remote_rev_history:
111
remote_extra.add(elem)
113
local_extra = list(local_extra)
114
local_extra.sort(key=local_rev_history_map.get)
115
remote_extra = list(remote_extra)
116
remote_extra.sort(key=remote_rev_history_map.get)
119
remote_branch.unlock()
121
local_branch.unlock()
122
return (local_extra, local_rev_history_map, remote_extra,
123
remote_rev_history_map)