summaryrefslogtreecommitdiff
path: root/contrib/fast-import
diff options
context:
space:
mode:
authorGary Gibbons <ggibbons@perforce.com>2012-01-02 18:05:51 -0500
committerJunio C Hamano <gitster@pobox.com>2012-01-03 14:10:02 -0800
commitdf5ed9077f18985a73f00fe2bacc2961598f73dc (patch)
treeac15614472351175a06e872da6f96427dd175291 /contrib/fast-import
parentb10048d0e9c4a209997c3b7f44021af15f88d768 (diff)
downloadgit-df5ed9077f18985a73f00fe2bacc2961598f73dc.tar.gz
git-p4: sort client views by reverse View number
Correct view sorting to support the Perforce order, where client views are ordered and later views override earlier view mappings. [pw: one test now succeeds] Signed-off-by: Gary Gibbons <ggibbons@perforce.com> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-xcontrib/fast-import/git-p411
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index c144c8960c..2fd4d3b2a6 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1924,10 +1924,17 @@ class P4Sync(Command, P4UserMap):
else:
include = len(v)
- temp[v] = (include, cv)
+ # store the View #number for sorting
+ # and the View string itself (this last for documentation)
+ temp[v] = (include, cv, int(k[4:]),k)
self.clientSpecDirs = temp.items()
- self.clientSpecDirs.sort( lambda x, y: abs( y[1][0] ) - abs( x[1][0] ) )
+ # Perforce ViewNN with higher #numbers override those with lower
+ # reverse sort on the View #number
+ self.clientSpecDirs.sort( lambda x, y: y[1][2] - x[1][2] )
+ if self.verbose:
+ for val in self.clientSpecDirs:
+ print "clientSpecDirs: %s %s" % (val[0],val[1])
def run(self, args):
self.depotPaths = []