Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed May 24, 2013
1 parent 6847825 commit 4fae767
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion p4-deleted
@@ -1,2 +1,2 @@
#!/bin/bash
p4 diff -sd ./...
p4 diff -sd $1
19 changes: 15 additions & 4 deletions p4-integrate
Expand Up @@ -6,14 +6,25 @@ $fromBranch = $argv[2];
$toBranch = $argv[3];

if (!$toBranch || !$fromBranch) {
exit ("usage: p4-integrate [changelist] [from-branch] [to-branch]\n");
exit ("usage: p4-integrate [changelist] [from-branch] [to-branch]\n");
}

if ($fromBranch === 'trunk' && 0 !== strpos('branches', $toBranch)) {
$toBranch .= 'branches/'.$toBranch;
}

$files = array_filter(explode("\n", `p4 -z tag describe -s $changeList | grep depotFile`));

foreach ($files as $i => $file) {
$files[$i] = substr($file, strpos($file, '//depot'));
}

foreach ($files as $file) {
$toFile = str_replace($fromBranch, $toBranch, $file);
echo "p4 integrate $file@$changeList $toFile\n";
echo `p4 integrate $file@$changeList $toFile`;
if (strpos($file, $fromBranch) !== false) {
$toFile = str_replace($fromBranch, $toBranch, $file);
echo "p4 integrate $file@$changeList $toFile\n";
echo `p4 integrate $file@$changeList $toFile`;
} else {
echo "skipped $file...\n";
}
}

0 comments on commit 4fae767

Please sign in to comment.