Removed cleantags command. It doesn't have any meaning anymore.
Signed-off-by: Simon Hausmann <simon@lst.de>
Simon Hausmann committed
May 17, 2007 at 19:44 UTC
8a2820def44f163ec8909863aefa5e8f98a236ea
1 file changed
-39
contrib/fast-import/git-p4
-39
@@ -129,44 +129,6 @@ class P4Debug(Command):
129
print output
130
return True
131
132
-class P4CleanTags(Command):
133
- def __init__(self):
134
- Command.__init__(self)
135
- self.options = [
136
-# optparse.make_option("--branch", dest="branch", default="refs/heads/master")
137
- ]
138
- self.description = "A tool to remove stale unused tags from incremental perforce imports."
139
- def run(self, args):
140
- branch = currentGitBranch()
141
- print "Cleaning out stale p4 import tags..."
142
- sout, sin, serr = popen2.popen3("git name-rev --tags `git rev-parse %s`" % branch)
143
- output = sout.read()
144
- try:
145
- tagIdx = output.index(" tags/p4/")
146
- except:
147
- print "Cannot find any p4/* tag. Nothing to do."
148
- sys.exit(0)
149
-
150
- try:
151
- caretIdx = output.index("^")
152
- except:
153
- caretIdx = len(output) - 1
154
- rev = int(output[tagIdx + 9 : caretIdx])
155
-
156
- allTags = mypopen("git tag -l p4/").readlines()
157
- for i in range(len(allTags)):
158
- allTags[i] = int(allTags[i][3:-1])
159
-
160
- allTags.sort()
161
-
162
- allTags.remove(rev)
163
-
164
- for rev in allTags:
165
- print mypopen("git tag -d p4/%s" % rev).read()
166
-
167
- print "%s tags removed." % len(allTags)
168
- return True
169
-
132
class P4Submit(Command):
133
def __init__(self):
134
Command.__init__(self)
@@ -1161,7 +1123,6 @@ def printUsage(commands):
1123
1124
commands = {
1125
"debug" : P4Debug(),
1164
- "clean-tags" : P4CleanTags(),
1126
"submit" : P4Submit(),
1127
"sync" : P4Sync(),
1128
"rebase" : P4Rebase(),