File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -1272,6 +1272,19 @@ class P4Sync(Command, P4UserMap):
1272
1272
text = p4_read_pipe ('print -q -o - "%s"' % file ['depotFile' ])
1273
1273
contents = [ text ]
1274
1274
1275
+ if type_base == "apple" :
1276
+ # Apple filetype files will be streamed as a concatenation of
1277
+ # its appledouble header and the contents. This is useless
1278
+ # on both macs and non-macs. If using "print -q -o xx", it
1279
+ # will create "xx" with the data, and "%xx" with the header.
1280
+ # This is also not very useful.
1281
+ #
1282
+ # Ideally, someday, this script can learn how to generate
1283
+ # appledouble files directly and import those to git, but
1284
+ # non-mac machines can never find a use for apple filetype.
1285
+ print "\n Ignoring apple filetype file %s" % file ['depotFile' ]
1286
+ return
1287
+
1275
1288
# Perhaps windows wants unicode, utf16 newlines translated too;
1276
1289
# but this is not doing it.
1277
1290
if self .isWindows and type_base == "text" :
Original file line number Diff line number Diff line change @@ -101,6 +101,37 @@ test_expect_success 'keyword file test' '
101
101
)
102
102
'
103
103
104
+ build_gendouble () {
105
+ cat > gendouble.py << -\EOF
106
+ import sys
107
+ import struct
108
+ import array
109
+
110
+ s = array.array("c", '\0' * 26)
111
+ struct.pack_into(">L", s, 0, 0x00051607) # AppleDouble
112
+ struct.pack_into(">L", s, 4, 0x00020000) # version 2
113
+ s.tofile(sys.stdout)
114
+ EOF
115
+ }
116
+
117
+ test_expect_success ' ignore apple' '
118
+ test_when_finished rm -f gendouble.py &&
119
+ build_gendouble &&
120
+ (
121
+ cd "$cli" &&
122
+ test-genrandom apple 1024 >double.png &&
123
+ "$PYTHON_PATH" "$TRASH_DIRECTORY/gendouble.py" >%double.png &&
124
+ p4 add -t apple double.png &&
125
+ p4 submit -d appledouble
126
+ ) &&
127
+ test_when_finished cleanup_git &&
128
+ "$GITP4" clone --dest="$git" //depot@all &&
129
+ (
130
+ cd "$git" &&
131
+ test ! -f double.png
132
+ )
133
+ '
134
+
104
135
test_expect_success ' kill p4d' '
105
136
kill_p4d
106
137
'
You can’t perform that action at this time.
0 commit comments