Skip to content

Commit cbc6924

Browse files
samhocevargitster
authored andcommitted
git-p4: support multiple depot paths in p4 submit
When submitting from a repository that was cloned using a client spec, use the full list of paths when ruling out files that are outside the view. This fixes a bug where only files pertaining to the first path would be included in the p4 submit. Signed-off-by: Sam Hocevar <[email protected]> Signed-off-by: Luke Diamand <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 785e70f commit cbc6924

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

git-p4.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,8 @@ def prepareSubmitTemplate(self):
14581458
Remove lines in the Files section that show changes to files
14591459
outside the depot path we're committing into."""
14601460

1461+
[upstream, settings] = findUpstreamBranchPoint()
1462+
14611463
template = ""
14621464
inFilesSection = False
14631465
for line in p4_read_pipe_lines(['change', '-o']):
@@ -1470,8 +1472,13 @@ def prepareSubmitTemplate(self):
14701472
lastTab = path.rfind("\t")
14711473
if lastTab != -1:
14721474
path = path[:lastTab]
1473-
if not p4PathStartsWith(path, self.depotPath):
1474-
continue
1475+
if settings.has_key('depot-paths'):
1476+
if not [p for p in settings['depot-paths']
1477+
if p4PathStartsWith(path, p)]:
1478+
continue
1479+
else:
1480+
if not p4PathStartsWith(path, self.depotPath):
1481+
continue
14751482
else:
14761483
inFilesSection = False
14771484
else:

0 commit comments

Comments
 (0)