MCPcopy Index your code
hub / github.com/git/git / streamTag

Method streamTag

git-p4.py:3355–3390  ·  view source on GitHub ↗

Stream a p4 tag. Commit is either a git commit, or a fast-import mark, ": ".

(self, gitStream, labelName, labelDetails, commit, epoch)

Source from the content-addressed store, hash-verified

3353 return b"%s <a@b>" % userid_bytes
3354
3355 def streamTag(self, gitStream, labelName, labelDetails, commit, epoch):
3356 """Stream a p4 tag.
3357
3358 Commit is either a git commit, or a fast-import mark, ":<p4commit>".
3359 """
3360
3361 if verbose:
3362 print("writing tag %s for commit %s" % (labelName, commit))
3363 gitStream.write("tag %s\n" % labelName)
3364 gitStream.write("from %s\n" % commit)
3365
3366 if 'Owner' in labelDetails:
3367 owner = labelDetails["Owner"]
3368 else:
3369 owner = None
3370
3371 # Try to use the owner of the p4 label, or failing that,
3372 # the current p4 user id.
3373 if owner:
3374 email = self.make_email(owner)
3375 else:
3376 email = self.make_email(self.p4UserId())
3377
3378 gitStream.write("tagger ")
3379 gitStream.write(email)
3380 gitStream.write(" %s %s\n" % (epoch, self.tz))
3381
3382 print("labelDetails=", labelDetails)
3383 if 'Description' in labelDetails:
3384 description = labelDetails['Description']
3385 else:
3386 description = 'Label from git p4'
3387
3388 gitStream.write("data %d\n" % len(description))
3389 gitStream.write(description)
3390 gitStream.write("\n")
3391
3392 def inClientSpec(self, path):
3393 if not self.clientSpecDirs:

Callers 2

commitMethod · 0.95
importP4LabelsMethod · 0.95

Calls 3

make_emailMethod · 0.95
p4UserIdMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected