# HG changeset patch # User Jeff Hammel # Date 1274887116 25200 # Node ID 448c248b3738a402661a2d63f329c745f9fe4c72 # Parent 44ea39c3e98fd7e4529b7cec5240fd9d9fb34223 start the path to using the __init__ function for realz diff -r 44ea39c3e98f -r 448c248b3738 hq/main.py --- a/hq/main.py Tue May 25 19:02:21 2010 -0700 +++ b/hq/main.py Wed May 26 08:18:36 2010 -0700 @@ -23,10 +23,16 @@ mercurial queue extension front-end policy manager """ - def __init__(self, parser, options): + def __init__(self, queue_host=None, network=True) """initialize global options""" # TODO: look at hgrc file # for [defaults] repository_host + # XXX ??? + + # check for network + self.network = network + + self.queue_host = queue_host def clone(self, repo, patch=None, queue=None): """ @@ -58,10 +64,12 @@ def commit(self, message): """ commit a patch and push it to the master repository + - message : commit message """ call(['hg', 'qrefresh']) call(['hg', 'qcommit', '-m', message]) - self._patch_command(*['hg', 'push']) + if self.network: + self._patch_command(*['hg', 'push']) def pull(self, repo=None): """ @@ -74,7 +82,8 @@ def goto(self, patch): """ - goto a specific patch + go to a specific patch and apply it + - patch: name of patch to go to """ # TODO process = subprocess.Popen(['hg', 'qapplied'], stdout=subprocess.PIPE)