{"thread":{"id":"1350","subject":"[PATCH] stgit: Handle 'A' flag for new files","startedAt":"2005-07-28T11:55:46Z","lastAt":"2005-07-28T12:20:32Z","messageCount":2,"participants":["Peter Osterlund","Catalin Marinas"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"6498","messageId":"m3d5p3kuv1.fsf@telia.com","threadId":"1350","inReplyTo":null,"subject":"[PATCH] stgit: Handle 'A' flag for new files","fromName":"Peter Osterlund","fromEmail":"petero2@telia.com","sentAt":"2005-07-28T11:55:46Z","receivedAt":"2005-07-28T11:55:46Z","isPatch":true,"sender":{"key":"petero2@telia.com","avatar":null},"body":"Hi,\n\nPatches that add new files don't work correctly if git reports them\nwith the 'A' flag. StGIT claims there are unresolved conflicts. This\npatch fixes it.\n\nSigned-off-by: Peter Osterlund <petero2@telia.com>\n\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -274,7 +274,7 @@ def commit(message, files = [], parents \n         raise GitException, 'No changes to commit'\n \n     # check for unresolved conflicts\n-    if not first and len(filter(lambda x: x[0] not in ['M', 'N', 'D'],\n+    if not first and len(filter(lambda x: x[0] not in ['M', 'N', 'A', 'D'],\n                                 cache_files)) != 0:\n         raise GitException, 'Commit failed: unresolved conflicts'\n \n\n-- \nPeter Osterlund - petero2@telia.com\nhttp://web.telia.com/~u89404340\n"},{"id":"6500","messageId":"tnxwtnbunov.fsf@arm.com","threadId":"1350","inReplyTo":"m3d5p3kuv1.fsf@telia.com","subject":"Re: [PATCH] stgit: Handle 'A' flag for new files","fromName":"Catalin Marinas","fromEmail":"catalin.marinas@gmail.com","sentAt":"2005-07-28T12:20:32Z","receivedAt":"2005-07-28T12:20:32Z","isPatch":true,"sender":{"key":"catalin.marinas@gmail.com","avatar":null},"body":"Peter Osterlund <petero2@telia.com> wrote:\n> Patches that add new files don't work correctly if git reports them\n> with the 'A' flag. StGIT claims there are unresolved conflicts. This\n> patch fixes it.\n\nThanks. Applied (together with the one below).\n\ndiff --git a/stgit/git.py b/stgit/git.py\n--- a/stgit/git.py\n+++ b/stgit/git.py\n@@ -292,7 +292,7 @@ def commit(message, files = [], parents\n         rm_files=[]\n         m_files=[]\n         for f in cache_files:\n-            if f[0] == 'N':\n+            if f[0] in ['N', 'A']:\n                 add_files.append(f[1])\n             elif f[0] == 'D':\n                 rm_files.append(f[1])\n@@ -437,7 +437,8 @@ def checkout(files = [], force = False):\n def switch(tree_id):\n     \"\"\"Switch the tree to the given id\n     \"\"\"\n-    to_delete = filter(lambda x: x[0] == 'N', __tree_status(tree_id = tree_id))+    to_delete = filter(lambda x: x[0] in ['N', 'A'],\n+                       __tree_status(tree_id = tree_id))\n\n     if __run('git-read-tree -m', [tree_id]) != 0:\n         raise GitException, 'Failed git-read-tree -m %s' % tree_id\n\n-- \nCatalin\n"}]}