Show More
@@ -1,4 +1,4 b'' | |||
|
1 | #!/usr/bin/env python | |
|
1 | # bisect extension for mercurial | |
|
2 | 2 | # |
|
3 | 3 | # This software may be used and distributed according to the terms |
|
4 | 4 | # of the GNU General Public License, incorporated herein by reference. |
@@ -91,7 +91,7 b' class bisect(object):' | |||
|
91 | 91 | if head is None: |
|
92 | 92 | head = self.badrev |
|
93 | 93 | return self.__ancestors_and_nb_ancestors(head, stop)[1] |
|
94 | ||
|
94 | ||
|
95 | 95 | def ancestors(self, head=None, stop=None): |
|
96 | 96 | """ |
|
97 | 97 | returns the set of the ancestors of head (self included) |
@@ -100,7 +100,7 b' class bisect(object):' | |||
|
100 | 100 | if head is None: |
|
101 | 101 | head = self.badrev |
|
102 | 102 | return self.__ancestors_and_nb_ancestors(head, stop)[0] |
|
103 | ||
|
103 | ||
|
104 | 104 | def __ancestors_and_nb_ancestors(self, head, stop=None): |
|
105 | 105 | """ |
|
106 | 106 | if stop is None then ancestors of goodrevs are used as |
@@ -131,7 +131,7 b' class bisect(object):' | |||
|
131 | 131 | for p in parents: |
|
132 | 132 | d[p][0] += 1 |
|
133 | 133 | return d |
|
134 | ||
|
134 | ||
|
135 | 135 | if head in stop: |
|
136 | 136 | self.ui.warn("Unconsistent state, %s is good and bad\n" |
|
137 | 137 | % hg.hex(head)) |
@@ -161,7 +161,8 b' class bisect(object):' | |||
|
161 | 161 | if not self.goodrevs: |
|
162 | 162 | self.ui.warn("No good revision given\n") |
|
163 | 163 | self.ui.warn("Assuming the first revision is good\n") |
|
164 |
ancestors, num_ancestors = self.__ancestors_and_nb_ancestors( |
|
|
164 | ancestors, num_ancestors = self.__ancestors_and_nb_ancestors( | |
|
165 | self.badrev) | |
|
165 | 166 | tot = len(ancestors) |
|
166 | 167 | if tot == 1: |
|
167 | 168 | if ancestors.pop() != self.badrev: |
@@ -260,7 +261,7 b' for subcommands see "hg bisect help\\"' | |||
|
260 | 261 | for cmd in cmds: |
|
261 | 262 | doc = cmdtable[cmd][0].__doc__.splitlines(0)[0].rstrip() |
|
262 | 263 | ui.write(" %-*s %s\n" % (m, cmd, doc)) |
|
263 | ||
|
264 | ||
|
264 | 265 | b = bisect(ui, repo) |
|
265 | 266 | bisectcmdtable = { |
|
266 | 267 | "init": (b.init, 0, "hg bisect init"), |
@@ -270,7 +271,7 b' for subcommands see "hg bisect help\\"' | |||
|
270 | 271 | "reset": (b.reset, 0, "hg bisect reset"), |
|
271 | 272 | "help": (help_, 1, "hg bisect help [<subcommand>]"), |
|
272 | 273 | } |
|
273 | ||
|
274 | ||
|
274 | 275 | if not bisectcmdtable.has_key(cmd): |
|
275 | 276 | ui.warn("bisect: Unknown sub-command\n") |
|
276 | 277 | return help_() |
@@ -280,7 +281,6 b' for subcommands see "hg bisect help\\"' | |||
|
280 | 281 | return bisectcmdtable[cmd][0](*args) |
|
281 | 282 | |
|
282 | 283 | cmdtable = { |
|
283 | "bisect": (bisect_run, [], | |
|
284 | "hg bisect [help|init|reset|next|good|bad]"), | |
|
284 | "bisect": (bisect_run, [], "hg bisect [help|init|reset|next|good|bad]"), | |
|
285 | 285 | #"bisect-test": (test, [], "hg bisect-test rev"), |
|
286 | 286 | } |
General Comments 0
You need to be logged in to leave comments.
Login now