{"thread":{"id":"13836","subject":"[StGIT PATCH 0/5] Proposed patches","startedAt":"2008-06-06T20:45:27Z","lastAt":"2008-06-08T22:03:15Z","messageCount":12,"participants":["Catalin Marinas","Karl Hasselström"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"78948","messageId":"20080606204322.8805.32313.stgit@localhost.localdomain","threadId":"13836","inReplyTo":null,"subject":"[StGIT PATCH 0/5] Proposed patches","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:45:27Z","receivedAt":"2008-06-06T20:45:27Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This series contains the patches pending in my \"proposed\" branch.\nThey've been updated following comments from Karl.\n\n\nCatalin Marinas (5):\n      Add test_patches target to Makefile\n      Convert \"init\" to the new StGIT infrastructure\n      Add stack creation and initialisation support to lib.Stack\n      Create a git.Branch class as ancestor of stack.Stack\n      Rename Repository.head to Repository.head_ref\n\n\n Makefile               |    9 ++++-\n stgit/commands/init.py |   14 ++-----\n stgit/commands/new.py  |    3 +-\n stgit/lib/git.py       |   58 ++++++++++++++++++++++++++++++-\n stgit/lib/stack.py     |   90 ++++++++++++++++++++++++++++++++++++------------\n 5 files changed, 137 insertions(+), 37 deletions(-)\n\n-- \nCatalin\n"},{"id":"78949","messageId":"20080606204537.8805.12051.stgit@localhost.localdomain","threadId":"13836","inReplyTo":"20080606204322.8805.32313.stgit@localhost.localdomain","subject":"[StGIT PATCH 1/5] Rename Repository.head to Repository.head_ref","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:45:37Z","receivedAt":"2008-06-06T20:45:37Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This is to avoid confusion with the Stack.head function which returns\na commit object rather than a file name. The patch also changes the\n\"new\" function to use stack.head directly rather than via the\nRepository.refs... object.\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\n stgit/commands/new.py |    3 +--\n stgit/lib/git.py      |    4 ++--\n stgit/lib/stack.py    |    2 +-\n 3 files changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/stgit/commands/new.py b/stgit/commands/new.py\nindex 15bb2e0..c4ee4e1 100644\n--- a/stgit/commands/new.py\n+++ b/stgit/commands/new.py\n@@ -58,9 +58,8 @@ def func(parser, options, args):\n     else:\n         parser.error('incorrect number of arguments')\n \n-    head = directory.repository.refs.get(directory.repository.head)\n     cd = gitlib.CommitData(\n-        tree = head.data.tree, parents = [head], message = '',\n+        tree = stack.head.data.tree, parents = [stack.head], message = '',\n         author = gitlib.Person.author(), committer = gitlib.Person.committer())\n \n     # Set patch commit message from commandline.\ndiff --git a/stgit/lib/git.py b/stgit/lib/git.py\nindex c9f01e3..fd66f6d 100644\n--- a/stgit/lib/git.py\n+++ b/stgit/lib/git.py\n@@ -443,13 +443,13 @@ class Repository(RunWithEnv):\n                                                 ).output_one_line()\n         return self.get_commit(sha1)\n     @property\n-    def head(self):\n+    def head_ref(self):\n         try:\n             return self.run(['git', 'symbolic-ref', '-q', 'HEAD']\n                             ).output_one_line()\n         except run.RunException:\n             raise DetachedHeadException()\n-    def set_head(self, ref, msg):\n+    def set_head_ref(self, ref, msg):\n         self.run(['git', 'symbolic-ref', '-m', msg, 'HEAD', ref]).no_output()\n     def simple_merge(self, base, ours, theirs):\n         \"\"\"Given three L{Tree}s, tries to do an in-index merge with a\ndiff --git a/stgit/lib/stack.py b/stgit/lib/stack.py\nindex bdd21b1..b1544a5 100644\n--- a/stgit/lib/stack.py\n+++ b/stgit/lib/stack.py\n@@ -178,7 +178,7 @@ class Repository(git.Repository):\n         self.__stacks = {} # name -> Stack\n     @property\n     def current_branch(self):\n-        return utils.strip_leading('refs/heads/', self.head)\n+        return utils.strip_leading('refs/heads/', self.head_ref)\n     @property\n     def current_stack(self):\n         return self.get_stack()\n"},{"id":"78950","messageId":"20080606204545.8805.29222.stgit@localhost.localdomain","threadId":"13836","inReplyTo":"20080606204322.8805.32313.stgit@localhost.localdomain","subject":"[StGIT PATCH 2/5] Create a git.Branch class as ancestor of stack.Stack","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:45:45Z","receivedAt":"2008-06-06T20:45:45Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This class deals with Git-specific branch commands. The Stack class is a\ndirect child of Branch and some of its functionality was moved to the new\nclass.\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\n stgit/lib/git.py   |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++\n stgit/lib/stack.py |   27 ++++++--------------------\n 2 files changed, 60 insertions(+), 21 deletions(-)\n\ndiff --git a/stgit/lib/git.py b/stgit/lib/git.py\nindex fd66f6d..0e0cccb 100644\n--- a/stgit/lib/git.py\n+++ b/stgit/lib/git.py\n@@ -28,6 +28,9 @@ class RepositoryException(exception.StgException):\n     \"\"\"Base class for all exceptions due to failed L{Repository}\n     operations.\"\"\"\n \n+class BranchException(exception.StgException):\n+    \"\"\"Exception raised by failed L{Branch} operations.\"\"\"\n+\n class DateException(exception.StgException):\n     \"\"\"Exception raised when a date+time string could not be parsed.\"\"\"\n     def __init__(self, string, type):\n@@ -379,6 +382,10 @@ class Repository(RunWithEnv):\n         except run.RunException:\n             raise RepositoryException('Cannot find git repository')\n     @property\n+    def current_branch_name(self):\n+        \"\"\"Return the name of the current branch.\"\"\"\n+        return utils.strip_leading('refs/heads/', self.head_ref)\n+    @property\n     def default_index(self):\n         \"\"\"An L{Index} object representing the default index file for the\n         repository.\"\"\"\n@@ -619,3 +626,50 @@ class IndexAndWorktree(RunWithEnvCwd):\n     def update_index(self, files):\n         self.run(['git', 'update-index', '--remove', '-z', '--stdin']\n                  ).input_nulterm(files).discard_output()\n+\n+class Branch(object):\n+    \"\"\"Represents a Git branch.\"\"\"\n+    def __init__(self, repository, name):\n+        self.__repository = repository\n+        self.__name = name\n+        try:\n+            self.head\n+        except KeyError:\n+            raise BranchException('%s: no such branch' % name)\n+\n+    name = property(lambda self: self.__name)\n+    repository = property(lambda self: self.__repository)\n+\n+    def __ref(self):\n+        return 'refs/heads/%s' % self.__name\n+    @property\n+    def head(self):\n+        return self.__repository.refs.get(self.__ref())\n+    def set_head(self, commit, msg):\n+        self.__repository.refs.set(self.__ref(), commit, msg)\n+\n+    def set_parent_remote(self, name):\n+        value = config.set('branch.%s.remote' % self.__name, name)\n+    def set_parent_branch(self, name):\n+        if config.get('branch.%s.remote' % self.__name):\n+            # Never set merge if remote is not set to avoid\n+            # possibly-erroneous lookups into 'origin'\n+            config.set('branch.%s.merge' % self.__name, name)\n+\n+    @classmethod\n+    def create(cls, repository, name, create_at = None):\n+        \"\"\"Create a new Git branch and return the corresponding\n+        L{Branch} object.\"\"\"\n+        try:\n+            branch = cls(repository, name)\n+        except BranchException:\n+            branch = None\n+        if branch:\n+            raise BranchException('%s: branch already exists' % name)\n+\n+        cmd = ['git', 'branch']\n+        if create_at:\n+            cmd.append(create_at.sha1)\n+        repository.run(['git', 'branch', create_at.sha1]).discard_output()\n+\n+        return cls(repository, name)\ndiff --git a/stgit/lib/stack.py b/stgit/lib/stack.py\nindex b1544a5..030c407 100644\n--- a/stgit/lib/stack.py\n+++ b/stgit/lib/stack.py\n@@ -130,34 +130,22 @@ class Patches(object):\n         self.__patches[name] = p\n         return p\n \n-class Stack(object):\n+class Stack(git.Branch):\n     \"\"\"Represents an StGit stack (that is, a git branch with some extra\n     metadata).\"\"\"\n+    __repo_subdir = 'patches'\n+\n     def __init__(self, repository, name):\n-        self.__repository = repository\n-        self.__name = name\n-        try:\n-            self.head\n-        except KeyError:\n-            raise exception.StgException('%s: no such branch' % name)\n+        git.Branch.__init__(self, repository, name)\n         self.__patchorder = PatchOrder(self)\n         self.__patches = Patches(self)\n         if not stackupgrade.update_to_current_format_version(repository, name):\n             raise exception.StgException('%s: branch not initialized' % name)\n-    name = property(lambda self: self.__name)\n-    repository = property(lambda self: self.__repository)\n     patchorder = property(lambda self: self.__patchorder)\n     patches = property(lambda self: self.__patches)\n     @property\n     def directory(self):\n-        return os.path.join(self.__repository.directory, 'patches', self.__name)\n-    def __ref(self):\n-        return 'refs/heads/%s' % self.__name\n-    @property\n-    def head(self):\n-        return self.__repository.refs.get(self.__ref())\n-    def set_head(self, commit, msg):\n-        self.__repository.refs.set(self.__ref(), commit, msg)\n+        return os.path.join(self.repository.directory, self.__repo_subdir, self.name)\n     @property\n     def base(self):\n         if self.patchorder.applied:\n@@ -177,14 +165,11 @@ class Repository(git.Repository):\n         git.Repository.__init__(self, *args, **kwargs)\n         self.__stacks = {} # name -> Stack\n     @property\n-    def current_branch(self):\n-        return utils.strip_leading('refs/heads/', self.head_ref)\n-    @property\n     def current_stack(self):\n         return self.get_stack()\n     def get_stack(self, name = None):\n         if not name:\n-            name = self.current_branch\n+            name = self.current_branch_name\n         if not name in self.__stacks:\n             self.__stacks[name] = Stack(self, name)\n         return self.__stacks[name]\n"},{"id":"78953","messageId":"20080606204554.8805.37257.stgit@localhost.localdomain","threadId":"13836","inReplyTo":"20080606204322.8805.32313.stgit@localhost.localdomain","subject":"[StGIT PATCH 3/5] Add stack creation and initialisation support to lib.Stack","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:45:54Z","receivedAt":"2008-06-06T20:45:54Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This patch adds the create and initialise Stack classmethods to handle\nthe initialisation of StGIT patch series on a Git branch.\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\n stgit/lib/stack.py |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 62 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/lib/stack.py b/stgit/lib/stack.py\nindex 030c407..9cb3967 100644\n--- a/stgit/lib/stack.py\n+++ b/stgit/lib/stack.py\n@@ -3,6 +3,10 @@\n import os.path\n from stgit import exception, utils\n from stgit.lib import git, stackupgrade\n+from stgit.config import config\n+\n+class StackException(exception.StgException):\n+    \"\"\"Exception raised by L{stack} objects.\"\"\"\n \n class Patch(object):\n     \"\"\"Represents an StGit patch. This class is mainly concerned with\n@@ -105,6 +109,14 @@ class PatchOrder(object):\n     all = property(lambda self: self.applied + self.unapplied + self.hidden)\n     all_visible = property(lambda self: self.applied + self.unapplied)\n \n+    @staticmethod\n+    def create(stackdir):\n+        \"\"\"Create the PatchOrder specific files\n+        \"\"\"\n+        utils.create_empty_file(os.path.join(stackdir, 'applied'))\n+        utils.create_empty_file(os.path.join(stackdir, 'unapplied'))\n+        utils.create_empty_file(os.path.join(stackdir, 'hidden'))\n+\n class Patches(object):\n     \"\"\"Creates L{Patch} objects. Makes sure there is only one such object\n     per patch.\"\"\"\n@@ -140,7 +152,7 @@ class Stack(git.Branch):\n         self.__patchorder = PatchOrder(self)\n         self.__patches = Patches(self)\n         if not stackupgrade.update_to_current_format_version(repository, name):\n-            raise exception.StgException('%s: branch not initialized' % name)\n+            raise StackException('%s: branch not initialized' % name)\n     patchorder = property(lambda self: self.__patchorder)\n     patches = property(lambda self: self.__patches)\n     @property\n@@ -158,6 +170,55 @@ class Stack(git.Branch):\n             return True\n         return self.head == self.patches.get(self.patchorder.applied[-1]).commit\n \n+    def set_parents(self, remote, branch):\n+        if remote:\n+            self.set_parent_remote(remote)\n+        if branch:\n+            self.set_parent_branch(branch)\n+\n+    @classmethod\n+    def initialise(cls, repository, name = None):\n+        \"\"\"Initialise a Git branch to handle patch series.\n+\n+        @param repository: The L{Repository} where the L{Stack} will be created\n+        @param name: The name of the L{Stack}\n+        \"\"\"\n+        if not name:\n+            name = repository.current_branch_name\n+        # make sure that the corresponding Git branch exists\n+        git.Branch(repository, name)\n+\n+        dir = os.path.join(repository.directory, cls.__repo_subdir, name)\n+        compat_dir = os.path.join(dir, 'patches')\n+        if os.path.exists(dir):\n+            raise StackException('%s: branch already initialized' % name)\n+\n+        # create the stack directory and files\n+        utils.create_dirs(dir)\n+        utils.create_dirs(compat_dir)\n+        PatchOrder.create(dir)\n+        config.set(stackupgrade.format_version_key(name),\n+                   str(stackupgrade.FORMAT_VERSION))\n+\n+        return repository.get_stack(name)\n+\n+    @classmethod\n+    def create(cls, repository, name,\n+               create_at = None, parent_remote = None, parent_branch = None):\n+        \"\"\"Create and initialise a Git branch returning the L{Stack} object.\n+\n+        @param repository: The L{Repository} where the L{Stack} will be created\n+        @param name: The name of the L{Stack}\n+        @param create_at: The Git id used as the base for the newly created\n+            Git branch\n+        @param parent_remote: The name of the remote Git branch\n+        @param parent_branch: The name of the parent Git branch\n+        \"\"\"\n+        git.Branch.create(repository, name, create_at = create_at)\n+        stack = cls.initialise(repository, name)\n+        stack.set_parents(parent_remote, parent_branch)\n+        return stack\n+\n class Repository(git.Repository):\n     \"\"\"A git L{Repository<git.Repository>} with some added StGit-specific\n     operations.\"\"\"\n"},{"id":"78952","messageId":"20080606204602.8805.44240.stgit@localhost.localdomain","threadId":"13836","inReplyTo":"20080606204322.8805.32313.stgit@localhost.localdomain","subject":"[StGIT PATCH 4/5] Convert \"init\" to the new StGIT infrastructure","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:46:02Z","receivedAt":"2008-06-06T20:46:02Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\n stgit/commands/init.py |   14 ++++----------\n 1 files changed, 4 insertions(+), 10 deletions(-)\n\ndiff --git a/stgit/commands/init.py b/stgit/commands/init.py\nindex 475a4ce..b68acd7 100644\n--- a/stgit/commands/init.py\n+++ b/stgit/commands/init.py\n@@ -16,13 +16,8 @@ along with this program; if not, write to the Free Software\n Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n \"\"\"\n \n-import sys, os\n-from optparse import OptionParser, make_option\n-\n-from stgit.commands.common import *\n-from stgit.utils import *\n-from stgit import stack, git\n-\n+from stgit.commands import common\n+from stgit.lib import stack\n \n help = 'initialise the current branch for use with StGIT'\n usage = \"\"\"%prog [options]\n@@ -31,14 +26,13 @@ Initialise the current GIT branch to be used as an StGIT stack. Note\n that you must already be in a GIT repository and .git/HEAD must point\n to a valid file in refs/heads/.\"\"\"\n \n-directory = DirectoryHasRepository()\n+directory = common.DirectoryHasRepositoryLib()\n options = []\n \n-\n def func(parser, options, args):\n     \"\"\"Performs the repository initialisation\n     \"\"\"\n     if len(args) != 0:\n         parser.error('incorrect number of arguments')\n \n-    crt_series.init()\n+    stack.Stack.initialise(directory.repository)\n"},{"id":"78951","messageId":"20080606204611.8805.45597.stgit@localhost.localdomain","threadId":"13836","inReplyTo":"20080606204322.8805.32313.stgit@localhost.localdomain","subject":"[StGIT PATCH 5/5] Add test_patches target to Makefile","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-06T20:46:11Z","receivedAt":"2008-06-06T20:46:11Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"This target tests individual patches in the series.\n\nSigned-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n---\n\n Makefile |    9 ++++++++-\n 1 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex c890b8e..e5c002a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2,6 +2,8 @@ PREFIX\t?= $(HOME)\n DESTDIR\t?= /\n PYTHON\t?= python\n \n+TEST_PATCHES ?= ..\n+\n all:\n \t$(PYTHON) setup.py build\n \n@@ -14,6 +16,11 @@ doc:\n test:\n \tcd t && $(MAKE) all\n \n+test_patches:\n+\tfor patch in $$(stg series --noprefix $(TEST_PATCHES)); do \\\n+\t\tstg goto $$patch && $(MAKE) test || break; \\\n+\tdone\n+\n clean:\n \tfor dir in Documentation t; do \\\n \t\t(cd $$dir && $(MAKE) clean); \\\n@@ -26,4 +33,4 @@ clean:\n tags:\n \tctags -e -R stgit/*\n \n-.PHONY: all install doc test clean\n+.PHONY: all install doc test test_patches clean\n"},{"id":"79029","messageId":"20080607090951.GC32647@diana.vm.bytemark.co.uk","threadId":"13836","inReplyTo":"20080606204537.8805.12051.stgit@localhost.localdomain","subject":"Re: [StGIT PATCH 1/5] Rename Repository.head to Repository.head_ref","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-07T09:09:51Z","receivedAt":"2008-06-07T09:09:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-06 21:45:37 +0100, Catalin Marinas wrote:\n\n> This is to avoid confusion with the Stack.head function which\n> returns a commit object rather than a file name. The patch also\n> changes the \"new\" function to use stack.head directly rather than\n> via the Repository.refs... object.\n>\n> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n\nAcked-by: Karl Hasselström <kha@treskal.com>\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"79031","messageId":"20080607091628.GD32647@diana.vm.bytemark.co.uk","threadId":"13836","inReplyTo":"20080606204545.8805.29222.stgit@localhost.localdomain","subject":"Re: [StGIT PATCH 2/5] Create a git.Branch class as ancestor of stack.Stack","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-07T09:16:28Z","receivedAt":"2008-06-07T09:16:28Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-06 21:45:45 +0100, Catalin Marinas wrote:\n\n> This class deals with Git-specific branch commands. The Stack class\n> is a direct child of Branch and some of its functionality was moved\n> to the new class.\n>\n> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n\nAcked-by: Karl Hasselström <kha@treskal.com>\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"79034","messageId":"20080607093051.GE32647@diana.vm.bytemark.co.uk","threadId":"13836","inReplyTo":"20080606204554.8805.37257.stgit@localhost.localdomain","subject":"Re: [StGIT PATCH 3/5] Add stack creation and initialisation support to lib.Stack","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-07T09:30:51Z","receivedAt":"2008-06-07T09:30:51Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-06 21:45:54 +0100, Catalin Marinas wrote:\n\n> This patch adds the create and initialise Stack classmethods to handle\n> the initialisation of StGIT patch series on a Git branch.\n>\n> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n\nAcked-by: Karl Hasselström <kha@treskal.com>\n\nI still have some comments, bu the patch looks good as-is.\n\n> +    @staticmethod\n> +    def create(stackdir):\n> +        \"\"\"Create the PatchOrder specific files\n> +        \"\"\"\n> +        utils.create_empty_file(os.path.join(stackdir, 'applied'))\n> +        utils.create_empty_file(os.path.join(stackdir, 'unapplied'))\n> +        utils.create_empty_file(os.path.join(stackdir, 'hidden'))\n\nMaybe s/create/create_files/ or soething to that effect here, as I\nsuggested in another mail a few minutes ago.\n\n> +    def set_parents(self, remote, branch):\n> +        if remote:\n> +            self.set_parent_remote(remote)\n> +        if branch:\n> +            self.set_parent_branch(branch)\n\nMuch clearer now. Interesting that the only reason we need this\nfunction at all is to make sure that set_parent_remote and\nset_parent_branch are called in the correct order.\n\nMaybe set_parent_branch should throw an exception instead of silently\ndoing nothing when there is no parent yet? It would force the callers\nto be more aware of the limitation -- though we might not actually\nwant that. Your call.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"79035","messageId":"20080607093234.GF32647@diana.vm.bytemark.co.uk","threadId":"13836","inReplyTo":"20080606204602.8805.44240.stgit@localhost.localdomain","subject":"Re: [StGIT PATCH 4/5] Convert \"init\" to the new StGIT infrastructure","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-07T09:32:34Z","receivedAt":"2008-06-07T09:32:34Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-06 21:46:02 +0100, Catalin Marinas wrote:\n\n> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n\nAcked-by: Karl Hasselström <kha@treskal.com>\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"79036","messageId":"20080607094247.GG32647@diana.vm.bytemark.co.uk","threadId":"13836","inReplyTo":"20080606204611.8805.45597.stgit@localhost.localdomain","subject":"Re: [StGIT PATCH 5/5] Add test_patches target to Makefile","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2008-06-07T09:42:47Z","receivedAt":"2008-06-07T09:42:47Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2008-06-06 21:46:11 +0100, Catalin Marinas wrote:\n\n> This target tests individual patches in the series.\n>\n> Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>\n\nLooks good. It doesn't run the tests with all patches popped, which my\ninvocation did, but I gues we needn't all be paranoid. :-) (And it\nwould be somewhat tricky to do now that you support testing an\narbitrary subset of the patches.)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"79174","messageId":"b0943d9e0806081503s1c25b2f3gbf68380c042d1cb0@mail.gmail.com","threadId":"13836","inReplyTo":"20080607093051.GE32647@diana.vm.bytemark.co.uk","subject":"Re: [StGIT PATCH 3/5] Add stack creation and initialisation support to lib.Stack","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2008-06-08T22:03:15Z","receivedAt":"2008-06-08T22:03:15Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"On 07/06/2008, Karl Hasselström <kha@treskal.com> wrote:\n> On 2008-06-06 21:45:54 +0100, Catalin Marinas wrote:\n>  > +    @staticmethod\n>  > +    def create(stackdir):\n>  > +        \"\"\"Create the PatchOrder specific files\n>  > +        \"\"\"\n>  > +        utils.create_empty_file(os.path.join(stackdir, 'applied'))\n>  > +        utils.create_empty_file(os.path.join(stackdir, 'unapplied'))\n>  > +        utils.create_empty_file(os.path.join(stackdir, 'hidden'))\n>\n>\n> Maybe s/create/create_files/ or soething to that effect here, as I\n>  suggested in another mail a few minutes ago.\n\nDone, no problem with that.\n\n>  > +    def set_parents(self, remote, branch):\n>  > +        if remote:\n>  > +            self.set_parent_remote(remote)\n>  > +        if branch:\n>  > +            self.set_parent_branch(branch)\n>\n>\n> Much clearer now. Interesting that the only reason we need this\n>  function at all is to make sure that set_parent_remote and\n>  set_parent_branch are called in the correct order.\n>\n>  Maybe set_parent_branch should throw an exception instead of silently\n>  doing nothing when there is no parent yet? It would force the callers\n>  to be more aware of the limitation -- though we might not actually\n>  want that. Your call.\n\nI can't argue much. I propose to commit the patch as is and modify it\nafterwards. I haven't touched this code much, it was Yann's\nimplementation and I forgot all the decisions at that time.\n\n-- \nCatalin\n"}]}