git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/5] git-p4 stream: check apple file type

From
PWPete Wyckoff <pw@padd.com>
Date
Jul 25, 2009, 14:24 UTC
Message-ID
<20090725142451.GE3841@arf.padd.com>
In-Reply-To
<20090725142329.GA3841@arf.padd.com>

Move this check into the function so both callers do it. And always reset the file contents in the main loop, as we just ignored this apple file.

Signed-off-by: Pete Wyckoff <pw@padd.com>
---
 contrib/fast-import/git-p4 |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 3ab016b..af66026 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -954,6 +954,11 @@ class P4Sync(Command):
     # - helper for streamP4Files
 
     def streamOneP4File(self, file, contents):
+	if file["type"] == "apple":
+	    print "\nfile %s is a strange apple file that forks. Ignoring" % \
+	    	  file['depotFile']
+	    return
+
         relPath = self.stripRepoPath(file['depotFile'], self.branchPrefixes)
         if verbose:
             sys.stderr.write("%s\n" % relPath)
@@ -1049,12 +1054,6 @@ class P4Sync(Command):
 
                     if marshalled.has_key('depotFile') and have_file_info:
                         # start of a new file - output the old one first
-
-                        if file["type"] == "apple":
-                            print "\nfile %s is a strange apple file that forks. Ignoring" % file['path']
-                            continue
-
-
                         self.streamOneP4File(file, contents)
                         file = {}
                         contents = []
-- 
1.6.2.5
Previous: Pete WyckoffNext: Pete Wyckoff
Message 6 of 7 in “git-p4: stream from perforce to speed up clones”
  1. git-p4: stream from perforce to speed up clonesLuke Diamand, Jul 11, 2009
  2. Pete WyckoffJul 25, 2009
  3. 1/5 git-p4 stream: remove unused functionPete Wyckoff, Jul 25, 2009
  4. 2/5 git-p4 stream: do not pass branchPrefixes so muchPete Wyckoff, Jul 25, 2009
  5. 3/5 git-p4 stream: show relative path in debug messagesPete Wyckoff, Jul 25, 2009
  6. 4/5 git-p4 stream: check apple file typePete Wyckoff, Jul 25, 2009
  7. 5/5 git-p4 stream: use existing p4CmdList with callbackPete Wyckoff, Jul 25, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.