Mercurial > hgsubversion
comparison util.py @ 152:1fde85a10f9e
push: Fix the bad implementation that required modifying the dirstate to push.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 22 Dec 2008 21:22:11 -0600 |
parents | 9ffde8662967 |
children | 6fa97cfbf62f |
comparison
equal
deleted
inserted
replaced
151:2decec74ad0c | 152:1fde85a10f9e |
---|---|
80 return [] | 80 return [] |
81 | 81 |
82 def __call__(self, fn): | 82 def __call__(self, fn): |
83 return fn.startswith(self.p) | 83 return fn.startswith(self.p) |
84 | 84 |
85 def outgoing_revisions(ui, repo, hg_editor, reverse_map): | 85 def outgoing_revisions(ui, repo, hg_editor, reverse_map, sourcerev): |
86 """Given a repo and an hg_editor, determines outgoing revisions for the | 86 """Given a repo and an hg_editor, determines outgoing revisions for the |
87 current working copy state. | 87 current working copy state. |
88 """ | 88 """ |
89 outgoing_rev_hashes = [] | 89 outgoing_rev_hashes = [] |
90 working_rev = repo.parents() | 90 if sourcerev in reverse_map: |
91 assert len(working_rev) == 1 | |
92 working_rev = working_rev[0] | |
93 if working_rev.node() in reverse_map: | |
94 return | 91 return |
95 while (not working_rev.node() in reverse_map | 92 sourcerev = repo[sourcerev] |
96 and working_rev.node() != node.nullid): | 93 while (not sourcerev.node() in reverse_map |
97 outgoing_rev_hashes.append(working_rev.node()) | 94 and sourcerev.node() != node.nullid): |
98 working_rev = working_rev.parents() | 95 outgoing_rev_hashes.append(sourcerev.node()) |
99 assert len(working_rev) == 1 | 96 sourcerev = sourcerev.parents() |
100 working_rev = working_rev[0] | 97 assert len(sourcerev) == 1 |
101 if working_rev.node() != node.nullid: | 98 sourcerev = sourcerev[0] |
99 if sourcerev.node() != node.nullid: | |
102 return outgoing_rev_hashes | 100 return outgoing_rev_hashes |
103 | 101 |
104 | 102 |
105 def is_svn_repo(repo): | 103 def is_svn_repo(repo): |
106 return os.path.exists(os.path.join(repo.path, 'svn')) | 104 return os.path.exists(os.path.join(repo.path, 'svn')) |