@@ -822,39 +822,37 @@ def p4ChangesForPaths(depotPaths, changeRange, requestedBlockSize):
822
822
die ("cannot use --changes-block-size with non-numeric revisions" )
823
823
block_size = None
824
824
825
- # Accumulate change numbers in a dictionary to avoid duplicates
826
- changes = {}
825
+ changes = []
827
826
828
- for p in depotPaths :
829
- # Retrieve changes a block at a time, to prevent running
830
- # into a MaxResults/MaxScanRows error from the server.
827
+ # Retrieve changes a block at a time, to prevent running
828
+ # into a MaxResults/MaxScanRows error from the server.
831
829
832
- while True :
833
- cmd = ['changes' ]
830
+ while True :
831
+ cmd = ['changes' ]
834
832
835
- if block_size :
836
- end = min (changeEnd , changeStart + block_size )
837
- revisionRange = "%d,%d" % (changeStart , end )
838
- else :
839
- revisionRange = "%s,%s" % (changeStart , changeEnd )
833
+ if block_size :
834
+ end = min (changeEnd , changeStart + block_size )
835
+ revisionRange = "%d,%d" % (changeStart , end )
836
+ else :
837
+ revisionRange = "%s,%s" % (changeStart , changeEnd )
840
838
839
+ for p in depotPaths :
841
840
cmd += ["%s...@%s" % (p , revisionRange )]
842
841
843
- for line in p4_read_pipe_lines ( cmd ):
844
- changeNum = int ( line . split ( " " )[ 1 ])
845
- changes [ changeNum ] = True
842
+ # Insert changes in chronological order
843
+ for line in reversed ( p4_read_pipe_lines ( cmd )):
844
+ changes . append ( int ( line . split ( " " )[ 1 ]))
846
845
847
- if not block_size :
848
- break
846
+ if not block_size :
847
+ break
849
848
850
- if end >= changeEnd :
851
- break
849
+ if end >= changeEnd :
850
+ break
852
851
853
- changeStart = end + 1
852
+ changeStart = end + 1
854
853
855
- changelist = changes .keys ()
856
- changelist .sort ()
857
- return changelist
854
+ changes = sorted (changes )
855
+ return changes
858
856
859
857
def p4PathStartsWith (path , prefix ):
860
858
# This method tries to remedy a potential mixed-case issue:
@@ -1458,6 +1456,8 @@ def prepareSubmitTemplate(self):
1458
1456
Remove lines in the Files section that show changes to files
1459
1457
outside the depot path we're committing into."""
1460
1458
1459
+ [upstream , settings ] = findUpstreamBranchPoint ()
1460
+
1461
1461
template = ""
1462
1462
inFilesSection = False
1463
1463
for line in p4_read_pipe_lines (['change' , '-o' ]):
@@ -1470,8 +1470,13 @@ def prepareSubmitTemplate(self):
1470
1470
lastTab = path .rfind ("\t " )
1471
1471
if lastTab != - 1 :
1472
1472
path = path [:lastTab ]
1473
- if not p4PathStartsWith (path , self .depotPath ):
1474
- continue
1473
+ if settings .has_key ('depot-paths' ):
1474
+ if not [p for p in settings ['depot-paths' ]
1475
+ if p4PathStartsWith (path , p )]:
1476
+ continue
1477
+ else :
1478
+ if not p4PathStartsWith (path , self .depotPath ):
1479
+ continue
1475
1480
else :
1476
1481
inFilesSection = False
1477
1482
else :
0 commit comments