@@ -222,10 +222,10 @@ def p4CmdList(cmd, stdin=None, stdin_mode='w+b', cb=None):
222
222
try :
223
223
while True :
224
224
entry = marshal .load (p4 .stdout )
225
- if cb is not None :
226
- cb (entry )
227
- else :
228
- result .append (entry )
225
+ if cb is not None :
226
+ cb (entry )
227
+ else :
228
+ result .append (entry )
229
229
except EOFError :
230
230
pass
231
231
exitCode = p4 .wait ()
@@ -449,8 +449,8 @@ def p4ChangesForPaths(depotPaths, changeRange):
449
449
450
450
changes = {}
451
451
for line in output :
452
- changeNum = int (line .split (" " )[1 ])
453
- changes [changeNum ] = True
452
+ changeNum = int (line .split (" " )[1 ])
453
+ changes [changeNum ] = True
454
454
455
455
changelist = changes .keys ()
456
456
changelist .sort ()
@@ -1033,10 +1033,10 @@ class P4Sync(Command):
1033
1033
# - helper for streamP4Files
1034
1034
1035
1035
def streamOneP4File (self , file , contents ):
1036
- if file ["type" ] == "apple" :
1037
- print "\n file %s is a strange apple file that forks. Ignoring" % \
1038
- file ['depotFile' ]
1039
- return
1036
+ if file ["type" ] == "apple" :
1037
+ print "\n file %s is a strange apple file that forks. Ignoring" % \
1038
+ file ['depotFile' ]
1039
+ return
1040
1040
1041
1041
relPath = self .stripRepoPath (file ['depotFile' ], self .branchPrefixes )
1042
1042
relPath = self .wildcard_decode (relPath )
@@ -1085,22 +1085,22 @@ class P4Sync(Command):
1085
1085
# handle another chunk of streaming data
1086
1086
def streamP4FilesCb (self , marshalled ):
1087
1087
1088
- if marshalled .has_key ('depotFile' ) and self .stream_have_file_info :
1089
- # start of a new file - output the old one first
1090
- self .streamOneP4File (self .stream_file , self .stream_contents )
1091
- self .stream_file = {}
1092
- self .stream_contents = []
1093
- self .stream_have_file_info = False
1088
+ if marshalled .has_key ('depotFile' ) and self .stream_have_file_info :
1089
+ # start of a new file - output the old one first
1090
+ self .streamOneP4File (self .stream_file , self .stream_contents )
1091
+ self .stream_file = {}
1092
+ self .stream_contents = []
1093
+ self .stream_have_file_info = False
1094
1094
1095
- # pick up the new file information... for the
1096
- # 'data' field we need to append to our array
1097
- for k in marshalled .keys ():
1098
- if k == 'data' :
1099
- self .stream_contents .append (marshalled ['data' ])
1100
- else :
1101
- self .stream_file [k ] = marshalled [k ]
1095
+ # pick up the new file information... for the
1096
+ # 'data' field we need to append to our array
1097
+ for k in marshalled .keys ():
1098
+ if k == 'data' :
1099
+ self .stream_contents .append (marshalled ['data' ])
1100
+ else :
1101
+ self .stream_file [k ] = marshalled [k ]
1102
1102
1103
- self .stream_have_file_info = True
1103
+ self .stream_have_file_info = True
1104
1104
1105
1105
# Stream directly from "p4 files" into "git fast-import"
1106
1106
def streamP4Files (self , files ):
@@ -1132,14 +1132,14 @@ class P4Sync(Command):
1132
1132
self .stream_contents = []
1133
1133
self .stream_have_file_info = False
1134
1134
1135
- # curry self argument
1136
- def streamP4FilesCbSelf (entry ):
1137
- self .streamP4FilesCb (entry )
1135
+ # curry self argument
1136
+ def streamP4FilesCbSelf (entry ):
1137
+ self .streamP4FilesCb (entry )
1138
1138
1139
- p4CmdList ("-x - print" ,
1140
- '\n ' .join (['%s#%s' % (f ['path' ], f ['rev' ])
1139
+ p4CmdList ("-x - print" ,
1140
+ '\n ' .join (['%s#%s' % (f ['path' ], f ['rev' ])
1141
1141
for f in filesToRead ]),
1142
- cb = streamP4FilesCbSelf )
1142
+ cb = streamP4FilesCbSelf )
1143
1143
1144
1144
# do the last chunk
1145
1145
if self .stream_file .has_key ('depotFile' ):
@@ -1148,7 +1148,7 @@ class P4Sync(Command):
1148
1148
def commit (self , details , files , branch , branchPrefixes , parent = "" ):
1149
1149
epoch = details ["time" ]
1150
1150
author = details ["user" ]
1151
- self .branchPrefixes = branchPrefixes
1151
+ self .branchPrefixes = branchPrefixes
1152
1152
1153
1153
if self .verbose :
1154
1154
print "commit into %s" % branch
@@ -1253,7 +1253,7 @@ class P4Sync(Command):
1253
1253
1254
1254
s = ''
1255
1255
for (key , val ) in self .users .items ():
1256
- s += "%s\t %s\n " % (key .expandtabs (1 ), val .expandtabs (1 ))
1256
+ s += "%s\t %s\n " % (key .expandtabs (1 ), val .expandtabs (1 ))
1257
1257
1258
1258
open (self .getUserCacheFilename (), "wb" ).write (s )
1259
1259
self .userMapFromPerforceServer = True
0 commit comments