Skip to content

Commit

Permalink
Merge branch 'ld/git-p4-tags-and-labels'
Browse files Browse the repository at this point in the history
By Luke Diamand
* ld/git-p4-tags-and-labels:
  git p4: fix bug when enabling tag import/export via config variables
  git p4: fix bug when verbose enabled with tag export
  git p4: add test for tag import/export enabled via config
  • Loading branch information
Junio C Hamano committed May 17, 2012
2 parents 2b26b65 + 06dcd15 commit 9b994b1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ def exportGitTags(self, gitTags):

if not m.match(name):
if verbose:
print "tag %s does not match regexp %s" % (name, validTagRegexp)
print "tag %s does not match regexp %s" % (name, validLabelRegexp)
continue

# Get the p4 commit this corresponds to
Expand Down Expand Up @@ -1451,7 +1451,7 @@ def run(self, args):
rebase.rebase()

if gitConfig("git-p4.exportLabels", "--bool") == "true":
self.exportLabels = true
self.exportLabels = True

if self.exportLabels:
p4Labels = getP4Labels(self.depotPath)
Expand Down Expand Up @@ -2711,7 +2711,7 @@ def run(self, args):
sys.stdout.write("\n")

if gitConfig("git-p4.importLabels", "--bool") == "true":
self.importLabels = true
self.importLabels = True

if self.importLabels:
p4Labels = getP4Labels(self.depotPaths)
Expand Down
20 changes: 20 additions & 0 deletions t/t9811-git-p4-label-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,26 @@ test_expect_success 'tag that cannot be exported' '
)
'

test_expect_success 'use git config to enable import/export of tags' '
git p4 clone --verbose --dest="$git" //depot@all &&
(
cd "$git" &&
git config git-p4.exportLabels true &&
git config git-p4.importLabels true &&
git tag CFG_A_GIT_TAG &&
git p4 rebase --verbose &&
git p4 submit --verbose &&
git tag &&
git tag | grep TAG_F1_1
) &&
(
cd "$cli" &&
p4 labels &&
p4 labels | grep CFG_A_GIT_TAG
)
'


test_expect_success 'kill p4d' '
kill_p4d
'
Expand Down

0 comments on commit 9b994b1

Please sign in to comment.