Skip to content

Commit 9b994b1

Browse files
committed
Merge branch 'ld/git-p4-tags-and-labels'
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
2 parents 2b26b65 + 06dcd15 commit 9b994b1

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

git-p4.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ def exportGitTags(self, gitTags):
13021302

13031303
if not m.match(name):
13041304
if verbose:
1305-
print "tag %s does not match regexp %s" % (name, validTagRegexp)
1305+
print "tag %s does not match regexp %s" % (name, validLabelRegexp)
13061306
continue
13071307

13081308
# Get the p4 commit this corresponds to
@@ -1451,7 +1451,7 @@ def run(self, args):
14511451
rebase.rebase()
14521452

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

14561456
if self.exportLabels:
14571457
p4Labels = getP4Labels(self.depotPath)
@@ -2711,7 +2711,7 @@ def run(self, args):
27112711
sys.stdout.write("\n")
27122712

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

27162716
if self.importLabels:
27172717
p4Labels = getP4Labels(self.depotPaths)

t/t9811-git-p4-label-import.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,26 @@ test_expect_success 'tag that cannot be exported' '
195195
)
196196
'
197197

198+
test_expect_success 'use git config to enable import/export of tags' '
199+
git p4 clone --verbose --dest="$git" //depot@all &&
200+
(
201+
cd "$git" &&
202+
git config git-p4.exportLabels true &&
203+
git config git-p4.importLabels true &&
204+
git tag CFG_A_GIT_TAG &&
205+
git p4 rebase --verbose &&
206+
git p4 submit --verbose &&
207+
git tag &&
208+
git tag | grep TAG_F1_1
209+
) &&
210+
(
211+
cd "$cli" &&
212+
p4 labels &&
213+
p4 labels | grep CFG_A_GIT_TAG
214+
)
215+
'
216+
217+
198218
test_expect_success 'kill p4d' '
199219
kill_p4d
200220
'

0 commit comments

Comments
 (0)