git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved
The branch detection code looks for branches under refs/remotes/p4/... and can end up getting confused if there are unshelved changes in there as well. This happens in the function p4BranchesInGit(). Instead, put the unshelved changes into refs/remotes/p4-unshelved/<N>. Signed-off-by: Luke Diamand <luke@diamand.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Luke Diamand committed
Oct 15, 2018 at 12:14 UTC
088131273b7e781174eb1cffb7d4e0eb51066cba
3 files changed
+8
-7
Documentation/git-p4.txt
+3
-3
@@ -174,7 +174,7 @@ $ git p4 submit --update-shelve 1234 --update-shelve 2345
174
Unshelve
175
~~~~~~~~
176
Unshelving will take a shelved P4 changelist, and produce the equivalent git commit
177
-in the branch refs/remotes/p4/unshelved/<changelist>.
177
+in the branch refs/remotes/p4-unshelved/<changelist>.
178
179
The git commit is created relative to the current origin revision (HEAD by default).
180
If the shelved changelist's parent revisions differ, git-p4 will refuse to unshelve;
@@ -182,13 +182,13 @@ you need to be unshelving onto an equivalent tree.
182
183
The origin revision can be changed with the "--origin" option.
184
185
-If the target branch in refs/remotes/p4/unshelved already exists, the old one will
185
+If the target branch in refs/remotes/p4-unshelved already exists, the old one will
186
be renamed.
187
188
----
189
$ git p4 sync
190
$ git p4 unshelve 12345
191
-$ git show refs/remotes/p4/unshelved/12345
191
+$ git show p4-unshelved/12345
192
<submit more changes via p4 to the same files>
193
$ git p4 unshelve 12345
194
<refuses to unshelve until git is in sync with p4 again>
git-p4.py
+2
-1
@@ -3956,7 +3956,8 @@ class P4Unshelve(Command):
3956
]
3957
self.verbose = False
3958
self.noCommit = False
3959
- self.destbranch = "refs/remotes/p4/unshelved"
3959
+ self.destbranch = "refs/remotes/p4-unshelved"
3960
+ self.origin = "p4/master"
3961
3962
def renameBranch(self, branch_name):
3963
""" Rename the existing branch to branch_name.N
t/t9832-unshelve.sh
+3
-3
@@ -54,8 +54,8 @@ EOF
54
cd "$git" &&
55
change=$(last_shelved_change) &&
56
git p4 unshelve $change &&
57
- git show refs/remotes/p4/unshelved/$change | grep -q "Further description" &&
58
- git cherry-pick refs/remotes/p4/unshelved/$change &&
57
+ git show refs/remotes/p4-unshelved/$change | grep -q "Further description" &&
58
+ git cherry-pick refs/remotes/p4-unshelved/$change &&
59
test_path_is_file file2 &&
60
test_cmp file1 "$cli"/file1 &&
61
test_cmp file2 "$cli"/file2 &&
@@ -88,7 +88,7 @@ EOF
88
cd "$git" &&
89
change=$(last_shelved_change) &&
90
git p4 unshelve $change &&
91
- git diff refs/remotes/p4/unshelved/$change.0 refs/remotes/p4/unshelved/$change | grep -q file3
91
+ git diff refs/remotes/p4-unshelved/$change.0 refs/remotes/p4-unshelved/$change | grep -q file3
92
)
93
'
94