comparison util.py @ 99:1da7aafdd323

Refactored outgoing_revisions into util where it really belongs.
author Augie Fackler <durin42@gmail.com>
date Fri, 21 Nov 2008 16:11:24 -0600
parents b3c7b844b782
children ed42f6e5705a
comparison
equal deleted inserted replaced
98:c7ac013cf7fd 99:1da7aafdd323
63 def files(self): 63 def files(self):
64 return [] 64 return []
65 65
66 def __call__(self, fn): 66 def __call__(self, fn):
67 return fn.startswith(self.p) 67 return fn.startswith(self.p)
68
69 def outgoing_revisions(ui, repo, hg_editor, reverse_map):
70 """Given a repo and an hg_editor, determines outgoing revisions for the
71 current working copy state.
72 """
73 outgoing_rev_hashes = []
74 working_rev = repo.parents()
75 assert len(working_rev) == 1
76 working_rev = working_rev[0]
77 if working_rev.node() in reverse_map:
78 return
79 while (not working_rev.node() in reverse_map
80 and working_rev.node() != node.nullid):
81 outgoing_rev_hashes.append(working_rev.node())
82 working_rev = working_rev.parents()
83 assert len(working_rev) == 1
84 working_rev = working_rev[0]
85 if working_rev.node() != node.nullid:
86 return outgoing_rev_hashes