git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] stgit: Handle 'A' flag for new files
@ 2005-07-28 11:55 Peter Osterlund
  2005-07-28 12:20 ` Catalin Marinas
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Osterlund @ 2005-07-28 11:55 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: git

Hi,

Patches that add new files don't work correctly if git reports them
with the 'A' flag. StGIT claims there are unresolved conflicts. This
patch fixes it.

Signed-off-by: Peter Osterlund <petero2@telia.com>

diff --git a/stgit/git.py b/stgit/git.py
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -274,7 +274,7 @@ def commit(message, files = [], parents 
         raise GitException, 'No changes to commit'
 
     # check for unresolved conflicts
-    if not first and len(filter(lambda x: x[0] not in ['M', 'N', 'D'],
+    if not first and len(filter(lambda x: x[0] not in ['M', 'N', 'A', 'D'],
                                 cache_files)) != 0:
         raise GitException, 'Commit failed: unresolved conflicts'
 

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] stgit: Handle 'A' flag for new files
  2005-07-28 11:55 [PATCH] stgit: Handle 'A' flag for new files Peter Osterlund
@ 2005-07-28 12:20 ` Catalin Marinas
  0 siblings, 0 replies; 2+ messages in thread
From: Catalin Marinas @ 2005-07-28 12:20 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: git

Peter Osterlund <petero2@telia.com> wrote:
> Patches that add new files don't work correctly if git reports them
> with the 'A' flag. StGIT claims there are unresolved conflicts. This
> patch fixes it.

Thanks. Applied (together with the one below).

diff --git a/stgit/git.py b/stgit/git.py
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -292,7 +292,7 @@ def commit(message, files = [], parents
         rm_files=[]
         m_files=[]
         for f in cache_files:
-            if f[0] == 'N':
+            if f[0] in ['N', 'A']:
                 add_files.append(f[1])
             elif f[0] == 'D':
                 rm_files.append(f[1])
@@ -437,7 +437,8 @@ def checkout(files = [], force = False):
 def switch(tree_id):
     """Switch the tree to the given id
     """
-    to_delete = filter(lambda x: x[0] == 'N', __tree_status(tree_id = tree_id))+    to_delete = filter(lambda x: x[0] in ['N', 'A'],
+                       __tree_status(tree_id = tree_id))

     if __run('git-read-tree -m', [tree_id]) != 0:
         raise GitException, 'Failed git-read-tree -m %s' % tree_id

-- 
Catalin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-28 12:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-28 11:55 [PATCH] stgit: Handle 'A' flag for new files Peter Osterlund
2005-07-28 12:20 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).