Skip to content

Commit 1082fb2

Browse files
committed
Merge branch 'pw/p4-view-updates'
* pw/p4-view-updates: git-p4: add tests demonstrating spec overlay ambiguities git-p4: adjust test to adhere to stricter useClientSpec git-p4: clarify comment git-p4: fix verbose comment typo git-p4: only a single ... wildcard is supported
2 parents 02a20d1 + 42d8c27 commit 1082fb2

File tree

4 files changed

+406
-7
lines changed

4 files changed

+406
-7
lines changed

Documentation/git-p4.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ around whitespace. Of the possible wildcards, git-p4 only handles
314314
'...', and only when it is at the end of the path. Git-p4 will complain
315315
if it encounters an unhandled wildcard.
316316

317+
Bugs in the implementation of overlap mappings exist. If multiple depot
318+
paths map through overlays to the same location in the repository,
319+
git-p4 can choose the wrong one. This is hard to solve without
320+
dedicating a client spec just for git-p4.
321+
317322
The name of the client can be given to git-p4 in multiple ways. The
318323
variable 'git-p4.client' takes precedence if it exists. Otherwise,
319324
normal p4 mechanisms of determining the client are used: environment

contrib/fast-import/git-p4

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,8 @@ class View(object):
12071207
die("Can't handle * wildcards in view: %s" % self.path)
12081208
triple_dot_index = self.path.find("...")
12091209
if triple_dot_index >= 0:
1210-
if not self.path.endswith("..."):
1211-
die("Can handle ... wildcard only at end of path: %s" %
1210+
if triple_dot_index != len(self.path) - 3:
1211+
die("Can handle only single ... wildcard, at end: %s" %
12121212
self.path)
12131213
self.ends_triple_dot = True
12141214

@@ -1263,7 +1263,7 @@ class View(object):
12631263
if self.exclude:
12641264
c = "-"
12651265
return "View.Mapping: %s%s -> %s" % \
1266-
(c, self.depot_side, self.client_side)
1266+
(c, self.depot_side.path, self.client_side.path)
12671267

12681268
def map_depot_to_client(self, depot_path):
12691269
"""Calculate the client path if using this mapping on the
@@ -1363,7 +1363,8 @@ class View(object):
13631363
else:
13641364
# This mapping matched; no need to search any further.
13651365
# But, the mapping could be rejected if the client path
1366-
# has already been claimed by an earlier mapping.
1366+
# has already been claimed by an earlier mapping (i.e.
1367+
# one later in the list, which we are walking backwards).
13671368
already_mapped_in_client = False
13681369
for f in paths_filled:
13691370
# this is View.Path.match

t/t9806-git-p4-options.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ test_expect_success 'clone --use-client-spec' '
146146
(
147147
cd "$git" &&
148148
test_path_is_file bus/dir/f4 &&
149-
test_path_is_file file1
149+
test_path_is_missing file1
150150
) &&
151151
cleanup_git &&
152152
@@ -159,7 +159,7 @@ test_expect_success 'clone --use-client-spec' '
159159
"$GITP4" sync //depot/... &&
160160
git checkout -b master p4/master &&
161161
test_path_is_file bus/dir/f4 &&
162-
test_path_is_file file1
162+
test_path_is_missing file1
163163
)
164164
'
165165

0 commit comments

Comments
 (0)