changeset 13:42a1de8a0bd5

remove obselete code
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 09 May 2013 15:07:36 -0700
parents 92484d1db1b2
children 46a68cd554b5
files hq/main.py
diffstat 1 files changed, 6 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/hq/main.py	Thu May 09 15:00:41 2013 -0700
+++ b/hq/main.py	Thu May 09 15:07:36 2013 -0700
@@ -34,6 +34,9 @@
         # hg binary
         self.binary = binary
 
+        # patch repo; not guaranteed to exit
+        self._patch_repo = self.os.path.join(self.root, '.hg', 'patches')
+
     ### subcommands
 
     def clone(self, repo, patch=None, queue=None):
@@ -110,11 +113,9 @@
         return '\n'.join([self._call(i).strip() for i in ('root', 'status', 'qseries')])
 
     def directory(self):
-        """
-        patch queue directory
-        """
-        patch_dir = os.path.join(self.root, '.hg', 'patches')
-        return patch_dir if os.path.isdir(patch_dir) else None
+        """patch queue directory"""
+        if os.path.isdir(self._patch_repo):
+            return self._patch_repo
 
     ### internals
 
@@ -122,11 +123,6 @@
         command = [self.binary] + list(args)
         return call(command, cwd=self.root)
 
-    def _patch_repo(self):
-        """the location of the patch repository"""
-        root = subprocess.Popen(['hg', 'root'], stdout=subprocess.PIPE).communicate()[0]
-        return os.path.join(root, '.hg', 'patches')
-
     def _patch_command(self, *command):
         """perform a command in the patch repository"""
         call(command, cwd=self.directory())