mirror of
https://github.com/git/git.git
synced 2024-06-08 12:26:13 +02:00
git-p4: accommodate new move/delete type in p4
562d53f
(git-p4: Fix sync errors due to new server version, 2010-01-21)
taught git-p4 sync to recognize the new move/delete type, but this type
can also show up in an initial clone and labels output.
Instead of replicating the support in three places, hoist the definition
somewhere global.
Signed-off-by: Pete Wyckoff <pw@padd.com>
Acked-By: Tor Arvid Lund <torarvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
1494fcbb75
commit
56c093451c
|
@ -834,6 +834,8 @@ class P4Submit(Command):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class P4Sync(Command):
|
class P4Sync(Command):
|
||||||
|
delete_actions = ( "delete", "move/delete", "purge" )
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
Command.__init__(self)
|
Command.__init__(self)
|
||||||
self.options = [
|
self.options = [
|
||||||
|
@ -1038,10 +1040,10 @@ class P4Sync(Command):
|
||||||
|
|
||||||
if includeFile:
|
if includeFile:
|
||||||
filesForCommit.append(f)
|
filesForCommit.append(f)
|
||||||
if f['action'] not in ('delete', 'move/delete', 'purge'):
|
if f['action'] in self.delete_actions:
|
||||||
filesToRead.append(f)
|
|
||||||
else:
|
|
||||||
filesToDelete.append(f)
|
filesToDelete.append(f)
|
||||||
|
else:
|
||||||
|
filesToRead.append(f)
|
||||||
|
|
||||||
# deleted files...
|
# deleted files...
|
||||||
for f in filesToDelete:
|
for f in filesToDelete:
|
||||||
|
@ -1127,7 +1129,7 @@ class P4Sync(Command):
|
||||||
|
|
||||||
cleanedFiles = {}
|
cleanedFiles = {}
|
||||||
for info in files:
|
for info in files:
|
||||||
if info["action"] in ("delete", "purge"):
|
if info["action"] in self.delete_actions:
|
||||||
continue
|
continue
|
||||||
cleanedFiles[info["depotFile"]] = info["rev"]
|
cleanedFiles[info["depotFile"]] = info["rev"]
|
||||||
|
|
||||||
|
@ -1453,7 +1455,7 @@ class P4Sync(Command):
|
||||||
if change > newestRevision:
|
if change > newestRevision:
|
||||||
newestRevision = change
|
newestRevision = change
|
||||||
|
|
||||||
if info["action"] in ("delete", "purge"):
|
if info["action"] in self.delete_actions:
|
||||||
# don't increase the file cnt, otherwise details["depotFile123"] will have gaps!
|
# don't increase the file cnt, otherwise details["depotFile123"] will have gaps!
|
||||||
#fileCnt = fileCnt + 1
|
#fileCnt = fileCnt + 1
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue