# HG changeset patch # User Thomas Arendsen Hein # Date 1141791396 -3600 # Node ID 0ba9dee8cfbdbe4d256418090b68b8c4ba56055f # Parent 638b1bc6c6c9a424d903cb77be343244d0b4b963 Fixed spacing/indentation, removed #! script header, added short description. diff --git a/contrib/hbisect.py b/contrib/hbisect.py --- a/contrib/hbisect.py +++ b/contrib/hbisect.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +# bisect extension for mercurial # # This software may be used and distributed according to the terms # of the GNU General Public License, incorporated herein by reference. @@ -91,7 +91,7 @@ class bisect(object): if head is None: head = self.badrev return self.__ancestors_and_nb_ancestors(head, stop)[1] - + def ancestors(self, head=None, stop=None): """ returns the set of the ancestors of head (self included) @@ -100,7 +100,7 @@ class bisect(object): if head is None: head = self.badrev return self.__ancestors_and_nb_ancestors(head, stop)[0] - + def __ancestors_and_nb_ancestors(self, head, stop=None): """ if stop is None then ancestors of goodrevs are used as @@ -131,7 +131,7 @@ class bisect(object): for p in parents: d[p][0] += 1 return d - + if head in stop: self.ui.warn("Unconsistent state, %s is good and bad\n" % hg.hex(head)) @@ -161,7 +161,8 @@ class bisect(object): if not self.goodrevs: self.ui.warn("No good revision given\n") self.ui.warn("Assuming the first revision is good\n") - ancestors, num_ancestors = self.__ancestors_and_nb_ancestors(self.badrev) + ancestors, num_ancestors = self.__ancestors_and_nb_ancestors( + self.badrev) tot = len(ancestors) if tot == 1: if ancestors.pop() != self.badrev: @@ -260,7 +261,7 @@ for subcommands see "hg bisect help\" for cmd in cmds: doc = cmdtable[cmd][0].__doc__.splitlines(0)[0].rstrip() ui.write(" %-*s %s\n" % (m, cmd, doc)) - + b = bisect(ui, repo) bisectcmdtable = { "init": (b.init, 0, "hg bisect init"), @@ -270,7 +271,7 @@ for subcommands see "hg bisect help\" "reset": (b.reset, 0, "hg bisect reset"), "help": (help_, 1, "hg bisect help []"), } - + if not bisectcmdtable.has_key(cmd): ui.warn("bisect: Unknown sub-command\n") return help_() @@ -280,7 +281,6 @@ for subcommands see "hg bisect help\" return bisectcmdtable[cmd][0](*args) cmdtable = { - "bisect": (bisect_run, [], - "hg bisect [help|init|reset|next|good|bad]"), + "bisect": (bisect_run, [], "hg bisect [help|init|reset|next|good|bad]"), #"bisect-test": (test, [], "hg bisect-test rev"), }