##// END OF EJS Templates
tag: don't allow tagging the null revision (issue1915)...
Brad Hall -
r17260:e432fb4b stable
parent child Browse files
Show More
@@ -5643,6 +5643,11 b' def tag(ui, repo, name1, *names, **opts)'
5643 if opts.get('edit'):
5643 if opts.get('edit'):
5644 message = ui.edit(message, ui.username())
5644 message = ui.edit(message, ui.username())
5645
5645
5646 # don't allow tagging the null rev
5647 if (not opts.get('remove') and
5648 scmutil.revsingle(repo, rev_).rev() == nullrev):
5649 raise util.Abort(_("null revision specified"))
5650
5646 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
5651 repo.tag(names, r, message, opts.get('local'), opts.get('user'), date)
5647 finally:
5652 finally:
5648 release(lock, wlock)
5653 release(lock, wlock)
@@ -176,7 +176,10 b' test http authentication'
176 clone of serve with repo in root and unserved subrepo (issue2970)
176 clone of serve with repo in root and unserved subrepo (issue2970)
177
177
178 $ hg --cwd test init sub
178 $ hg --cwd test init sub
179 $ hg --cwd test/sub tag something
179 $ echo empty > test/sub/empty
180 $ hg --cwd test/sub add empty
181 $ hg --cwd test/sub commit -qm 'add empty'
182 $ hg --cwd test/sub tag -r 0 something
180 $ echo sub = sub > test/.hgsub
183 $ echo sub = sub > test/.hgsub
181 $ hg --cwd test add .hgsub
184 $ hg --cwd test add .hgsub
182 $ hg --cwd test commit -qm 'add subrepo'
185 $ hg --cwd test commit -qm 'add subrepo'
@@ -278,9 +278,12 b' hide outer repo'
278 Test remote paths with spaces (issue2983):
278 Test remote paths with spaces (issue2983):
279
279
280 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
280 $ hg init --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
281 $ touch "$TESTTMP/a repo/test"
282 $ hg -R 'a repo' commit -A -m "test"
283 adding test
281 $ hg -R 'a repo' tag tag
284 $ hg -R 'a repo' tag tag
282 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
285 $ hg id --ssh "python \"$TESTDIR/dummyssh\"" "ssh://user@dummy/a repo"
283 3fb238f49e8c
286 73649e48688a
284
287
285 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
288 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
286 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
289 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
@@ -296,7 +299,7 b' parameters:'
296 > EOF
299 > EOF
297
300
298 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
301 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
299 3fb238f49e8c
302 73649e48688a
300
303
301 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
304 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
302 remote: Illegal repository "$TESTTMP/a'repo" (glob)
305 remote: Illegal repository "$TESTTMP/a'repo" (glob)
@@ -112,6 +112,9 b' test with "/" URI (issue 747) and subrep'
112
112
113 $ hg init
113 $ hg init
114 $ hg init sub
114 $ hg init sub
115 $ touch sub/test
116 $ hg -R sub commit -A -m "test"
117 adding test
115 $ hg -R sub tag not-empty
118 $ hg -R sub tag not-empty
116 $ echo sub=sub > .hgsub
119 $ echo sub=sub > .hgsub
117 $ echo a > a
120 $ echo a > a
@@ -129,7 +132,7 b' test with "/" URI (issue 747) and subrep'
129 adding changesets
132 adding changesets
130 adding manifests
133 adding manifests
131 adding file changes
134 adding file changes
132 added 1 changesets with 1 changes to 1 files
135 added 2 changesets with 2 changes to 2 files
133 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
136 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 $ cd local2
137 $ cd local2
135 $ hg verify
138 $ hg verify
@@ -248,7 +248,6 b" tagging when at named-branch-head that's"
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
249 $ hg tag new-topo-head
249 $ hg tag new-topo-head
250
250
251
252 tagging on null rev
251 tagging on null rev
253
252
254 $ hg up null
253 $ hg up null
@@ -259,6 +258,12 b' tagging on null rev'
259
258
260 $ hg init empty
259 $ hg init empty
261 $ hg tag -R empty nullrev
260 $ hg tag -R empty nullrev
261 abort: null revision specified
262 [255]
263
264 $ hg tag -R empty -r 00000000000 -f nulltag
265 abort: null revision specified
266 [255]
262
267
263 $ cd ..
268 $ cd ..
264
269
@@ -300,6 +305,9 b' tagging on an uncommitted merge (issue25'
300 commit hook on tag used to be run without write lock - issue3344
305 commit hook on tag used to be run without write lock - issue3344
301
306
302 $ hg init repo-tag
307 $ hg init repo-tag
308 $ touch repo-tag/test
309 $ hg -R repo-tag commit -A -m "test"
310 adding test
303 $ hg init repo-tag-target
311 $ hg init repo-tag-target
304 $ hg -R repo-tag --config hooks.commit="\"hg\" push \"`pwd`/repo-tag-target\"" tag tag
312 $ hg -R repo-tag --config hooks.commit="\"hg\" push \"`pwd`/repo-tag-target\"" tag tag
305 pushing to $TESTTMP/repo-tag-target
313 pushing to $TESTTMP/repo-tag-target
@@ -307,5 +315,5 b' commit hook on tag used to be run withou'
307 adding changesets
315 adding changesets
308 adding manifests
316 adding manifests
309 adding file changes
317 adding file changes
310 added 1 changesets with 1 changes to 1 files
318 added 2 changesets with 2 changes to 2 files
311
319
General Comments 0
You need to be logged in to leave comments. Login now