summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-p4.py6
-rwxr-xr-xt/t9811-git-p4-label-import.sh20
2 files changed, 23 insertions, 3 deletions
diff --git a/git-p4.py b/git-p4.py
index 565cfbcc78..f895a2412b 100755
--- a/git-p4.py
+++ b/git-p4.py
@@ -1302,7 +1302,7 @@ class P4Submit(Command, P4UserMap):
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
@@ -1451,7 +1451,7 @@ class P4Submit(Command, P4UserMap):
rebase.rebase()
if gitConfig("git-p4.exportLabels", "--bool") == "true":
- self.exportLabels = true
+ self.exportLabels = True
if self.exportLabels:
p4Labels = getP4Labels(self.depotPath)
@@ -2711,7 +2711,7 @@ class P4Sync(Command, P4UserMap):
sys.stdout.write("\n")
if gitConfig("git-p4.importLabels", "--bool") == "true":
- self.importLabels = true
+ self.importLabels = True
if self.importLabels:
p4Labels = getP4Labels(self.depotPaths)
diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index fb00ffab24..095238fffe 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -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
'