summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2009-12-22 03:57:17 -0800
committerChristian Hammond <chipx86@chipx86.com>2009-12-22 03:57:17 -0800
commit9d1648a4305cd16187a1693da9da2173692d1ed9 (patch)
treeaeab17f672fc31fffc10480e39694bd98ffaf93f
parenta39e3f27d01594f9cd58f4727723a7d5c1c544b1 (diff)
Support the new move/add and move/delete operations in Perforce.
New versions of Perforce provide more explicit information when moving files. There are two new types: move/add and move/delete. These more or less map (for our purposes) to just add and delete. We should now handle them. Fixes bug #1417
-rwxr-xr-xrbtools/postreview.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/rbtools/postreview.py b/rbtools/postreview.py
index 34c4591..2cc36ba 100755
--- a/rbtools/postreview.py
+++ b/rbtools/postreview.py
@@ -1641,7 +1641,10 @@ class PerforceClient(SCMClient):
if not line:
continue
- m = re.search(r'\.\.\. ([^#]+)#(\d+) (add|edit|delete|integrate|branch)', line)
+ m = re.search(r'\.\.\. ([^#]+)#(\d+) '
+ r'(add|edit|delete|integrate|branch|move/add'
+ r'|move/delete)',
+ line)
if not m:
die("Unsupported line from p4 opened: %s" % line)
@@ -1661,7 +1664,7 @@ class PerforceClient(SCMClient):
old_depot_path = new_depot_path = None
changetype_short = None
- if changetype == 'edit' or changetype == 'integrate':
+ if changetype in ['edit', 'integrate']:
# A big assumption
new_revision = base_revision + 1
@@ -1680,8 +1683,7 @@ class PerforceClient(SCMClient):
new_file = tmp_diff_to_filename
changetype_short = "M"
-
- elif changetype == 'add' or changetype == 'branch':
+ elif changetype in ['add', 'branch', 'move/add']:
# We have a new file, get p4 to put this new file into a pretty
# temp file for us. No old file to worry about here.
if cl_is_pending:
@@ -1690,8 +1692,7 @@ class PerforceClient(SCMClient):
self._write_file(depot_path, tmp_diff_to_filename)
new_file = tmp_diff_to_filename
changetype_short = "A"
-
- elif changetype == 'delete':
+ elif changetype in ['delete', 'move/delete']:
# We've deleted a file, get p4 to put the deleted file into a temp
# file for us. The new file remains the empty file.
old_depot_path = "%s#%s" % (depot_path, base_revision)