changeset 5:448c248b3738

start the path to using the __init__ function for realz
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 26 May 2010 08:18:36 -0700
parents 44ea39c3e98f
children 321721b581f1
files hq/main.py
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)