mirror of
https://github.com/git/git.git
synced 2024-10-05 05:41:34 +02:00
Cleanup, removed the old tagging code
Signed-off-by: Simon Hausmann <simon@lst.de>
This commit is contained in:
parent
8f8725314d
commit
2835925139
@ -455,7 +455,6 @@ class P4Sync(Command):
|
|||||||
self.detectBranches = False
|
self.detectBranches = False
|
||||||
self.detectLabels = False
|
self.detectLabels = False
|
||||||
self.changesFile = ""
|
self.changesFile = ""
|
||||||
self.tagLastChange = True
|
|
||||||
|
|
||||||
def p4File(self, depotPath):
|
def p4File(self, depotPath):
|
||||||
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
|
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
|
||||||
@ -858,15 +857,11 @@ class P4Sync(Command):
|
|||||||
self.depotPath = self.previousDepotPath
|
self.depotPath = self.previousDepotPath
|
||||||
self.changeRange = "@%s,#head" % p4Change
|
self.changeRange = "@%s,#head" % p4Change
|
||||||
self.initialParent = self.branch
|
self.initialParent = self.branch
|
||||||
self.tagLastChange = False
|
|
||||||
if not self.silent:
|
if not self.silent:
|
||||||
print "Performing incremental import into %s git branch" % self.branch
|
print "Performing incremental import into %s git branch" % self.branch
|
||||||
|
|
||||||
self.branch = "refs/heads/" + self.branch
|
self.branch = "refs/heads/" + self.branch
|
||||||
|
|
||||||
if len(self.depotPath) == 0:
|
|
||||||
self.depotPath = self.previousDepotPath = os.popen("git repo-config --get p4.depotpath").read()
|
|
||||||
|
|
||||||
if len(self.depotPath) != 0:
|
if len(self.depotPath) != 0:
|
||||||
self.depotPath = self.depotPath[:-1]
|
self.depotPath = self.depotPath[:-1]
|
||||||
|
|
||||||
@ -884,7 +879,6 @@ class P4Sync(Command):
|
|||||||
self.revision = ""
|
self.revision = ""
|
||||||
self.users = {}
|
self.users = {}
|
||||||
self.lastChange = 0
|
self.lastChange = 0
|
||||||
self.initialTag = ""
|
|
||||||
|
|
||||||
if self.depotPath.find("@") != -1:
|
if self.depotPath.find("@") != -1:
|
||||||
atIdx = self.depotPath.index("@")
|
atIdx = self.depotPath.index("@")
|
||||||
@ -927,7 +921,6 @@ class P4Sync(Command):
|
|||||||
self.rev = int(output[tagIdx + 9 : endPos]) + 1
|
self.rev = int(output[tagIdx + 9 : endPos]) + 1
|
||||||
self.changeRange = "@%s,#head" % self.rev
|
self.changeRange = "@%s,#head" % self.rev
|
||||||
self.initialParent = os.popen("git rev-parse %s" % self.branch).read()[:-1]
|
self.initialParent = os.popen("git rev-parse %s" % self.branch).read()[:-1]
|
||||||
self.initialTag = "p4/%s" % (int(self.rev) - 1)
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -1049,20 +1042,12 @@ class P4Sync(Command):
|
|||||||
if not self.silent:
|
if not self.silent:
|
||||||
print ""
|
print ""
|
||||||
|
|
||||||
if self.tagLastChange:
|
|
||||||
self.gitStream.write("reset refs/tags/p4/%s\n" % self.lastChange)
|
|
||||||
self.gitStream.write("from %s\n\n" % self.branch);
|
|
||||||
|
|
||||||
|
|
||||||
self.gitStream.close()
|
self.gitStream.close()
|
||||||
self.gitOutput.close()
|
self.gitOutput.close()
|
||||||
self.gitError.close()
|
self.gitError.close()
|
||||||
importProcess.wait()
|
importProcess.wait()
|
||||||
|
|
||||||
os.popen("git repo-config p4.depotpath %s" % self.depotPath).read()
|
|
||||||
if len(self.initialTag) > 0:
|
|
||||||
os.popen("git tag -d %s" % self.initialTag).read()
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class P4Rebase(Command):
|
class P4Rebase(Command):
|
||||||
@ -1086,7 +1071,6 @@ class P4Clone(P4Sync):
|
|||||||
self.description = "Creates a new git repository and imports from Perforce into it"
|
self.description = "Creates a new git repository and imports from Perforce into it"
|
||||||
self.usage = "usage: %prog [options] //depot/path[@revRange] [directory]"
|
self.usage = "usage: %prog [options] //depot/path[@revRange] [directory]"
|
||||||
self.needsGit = False
|
self.needsGit = False
|
||||||
self.tagLastChange = False
|
|
||||||
|
|
||||||
def run(self, args):
|
def run(self, args):
|
||||||
if len(args) < 1:
|
if len(args) < 1:
|
||||||
|
Loading…
Reference in New Issue
Block a user