{"thread":{"id":"2537","subject":"[PATCH 0/2] Two more small clean-ups","startedAt":"2005-11-15T22:51:36Z","lastAt":"2005-11-15T22:52:56Z","messageCount":3,"participants":["Chuck Lever"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"11947","messageId":"20051115225136.16350.96122.stgit@dexter.citi.umich.edu","threadId":"2537","inReplyTo":null,"subject":"[PATCH 0/2] Two more small clean-ups","fromName":"Chuck Lever","fromEmail":"cel@citi.umich.edu","sentAt":"2005-11-15T22:51:36Z","receivedAt":"2005-11-15T22:51:36Z","isPatch":true,"sender":{"key":"cel@citi.umich.edu","avatar":null},"body":"        -- Chuck Lever\n--\ncorporate:    <cel at netapp dot com>\npersonal:     <chucklever at bigfoot dot com>\n"},{"id":"11949","messageId":"20051115225254.16350.65938.stgit@dexter.citi.umich.edu","threadId":"2537","inReplyTo":"20051115225136.16350.96122.stgit@dexter.citi.umich.edu","subject":"[PATCH 1/2] Cleanup: remove unused variable","fromName":"Chuck Lever","fromEmail":"cel@netapp.com","sentAt":"2005-11-15T22:52:54Z","receivedAt":"2005-11-15T22:52:54Z","isPatch":true,"sender":{"key":"cel@netapp.com","avatar":null},"body":"Get rid of git.py:head_link , as it is no longer used by any part of\nStGIT.\n\nSigned-off-by: Chuck Lever <cel@netapp.com>\n---\n\n stgit/git.py |    1 -\n 1 files changed, 0 insertions(+), 1 deletions(-)\n\ndiff --git a/stgit/git.py b/stgit/git.py\nindex 9a07fa5..066a8f0 100644\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -33,7 +33,6 @@ if 'GIT_DIR' in os.environ:\n else:\n     base_dir = '.git'\n \n-head_link = os.path.join(base_dir, 'HEAD')\n \n #\n # Classes\n"},{"id":"11948","messageId":"20051115225256.16350.73548.stgit@dexter.citi.umich.edu","threadId":"2537","inReplyTo":"20051115225136.16350.96122.stgit@dexter.citi.umich.edu","subject":"[PATCH 2/2] Clean up StGIT's \"branch --delete\" command","fromName":"Chuck Lever","fromEmail":"cel@netapp.com","sentAt":"2005-11-15T22:52:56Z","receivedAt":"2005-11-15T22:52:56Z","isPatch":true,"sender":{"key":"cel@netapp.com","avatar":null},"body":"os.path.isfile is not the same as os.path.exists.\n\nSigned-off-by: Chuck Lever <cel@netapp.com>\n---\n\n stgit/stack.py |   21 +++++++++++----------\n 1 files changed, 11 insertions(+), 10 deletions(-)\n\ndiff --git a/stgit/stack.py b/stgit/stack.py\nindex 0907b37..7bf7e7c 100644\n--- a/stgit/stack.py\n+++ b/stgit/stack.py\n@@ -404,16 +404,17 @@ class Series:\n         \"\"\"Renames a series\n         \"\"\"\n         to_stack = Series(to_name)\n-        if os.path.isdir(to_stack.__patch_dir):\n-            raise StackException, '\"%s\" already exists' % to_stack.__patch_dir\n-        if os.path.isfile(to_stack.__base_file):\n-            raise StackException, '\"%s\" already exists' % to_stack.__base_file\n+\n+        if to_stack.is_initialised:\n+            raise StackException, '\"%s\" already exists' % to_stack.get_branch()\n+        if os.path.exists(to_stack.__base_file):\n+            os.remove(to_stack.__base_file)\n \n         git.rename_branch(self.__name, to_name)\n \n         if os.path.isdir(self.__patch_dir):\n             os.rename(self.__patch_dir, to_stack.__patch_dir)\n-        if os.path.isfile(self.__base_file):\n+        if os.path.exists(self.__base_file):\n             os.rename(self.__base_file, to_stack.__base_file)\n \n         self.__init__(to_name)\n@@ -430,20 +431,20 @@ class Series:\n             for p in patches:\n                 self.delete_patch(p)\n \n-            if os.path.isfile(self.__applied_file):\n+            if os.path.exists(self.__applied_file):\n                 os.remove(self.__applied_file)\n-            if os.path.isfile(self.__unapplied_file):\n+            if os.path.exists(self.__unapplied_file):\n                 os.remove(self.__unapplied_file)\n-            if os.path.isfile(self.__current_file):\n+            if os.path.exists(self.__current_file):\n                 os.remove(self.__current_file)\n-            if os.path.isfile(self.__descr_file):\n+            if os.path.exists(self.__descr_file):\n                 os.remove(self.__descr_file)\n             if not os.listdir(self.__patch_dir):\n                 os.rmdir(self.__patch_dir)\n             else:\n                 print 'Series directory %s is not empty.' % self.__name\n \n-        if os.path.isfile(self.__base_file):\n+        if os.path.exists(self.__base_file):\n             os.remove(self.__base_file)\n \n     def refresh_patch(self, message = None, edit = False, show_patch = False,\n"}]}