Show More
@@ -102,11 +102,7 b' def _destupdatebranch(repo, clean, check' | |||||
102 | if bookmarks.isactivewdirparent(repo): |
|
102 | if bookmarks.isactivewdirparent(repo): | |
103 | movemark = repo['.'].node() |
|
103 | movemark = repo['.'].node() | |
104 | else: |
|
104 | else: | |
105 | if currentbranch == 'default': # no default branch! |
|
105 | node = repo['.'].node() | |
106 | # update to the tipmost non-closed branch head |
|
|||
107 | node = repo.revs('max(head() and not closed())').first() |
|
|||
108 | else: |
|
|||
109 | raise error.Abort(_("branch %s not found") % currentbranch) |
|
|||
110 | return node, movemark, None |
|
106 | return node, movemark, None | |
111 |
|
107 | |||
112 | def _destupdatebranchfallback(repo, clean, check): |
|
108 | def _destupdatebranchfallback(repo, clean, check): |
@@ -211,8 +211,7 b' Update with no arguments: tipmost revisi' | |||||
211 | marked working directory as branch foobar |
|
211 | marked working directory as branch foobar | |
212 |
|
212 | |||
213 | $ hg up |
|
213 | $ hg up | |
214 | abort: branch foobar not found |
|
214 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
215 | [255] |
|
|||
216 |
|
215 | |||
217 | Fast-forward merge: |
|
216 | Fast-forward merge: | |
218 |
|
217 | |||
@@ -345,3 +344,50 b' 2 branch heads, implicit merge works:' | |||||
345 | (branch merge, don't forget to commit) |
|
344 | (branch merge, don't forget to commit) | |
346 |
|
345 | |||
347 | $ cd .. |
|
346 | $ cd .. | |
|
347 | ||||
|
348 | We expect that bare update on new branch, updates to parent | |||
|
349 | ||||
|
350 | $ hg init bareupdateonnewbranch | |||
|
351 | $ cd bareupdateonnewbranch | |||
|
352 | $ hg update | |||
|
353 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
354 | $ touch a | |||
|
355 | $ hg commit -A -m "a" | |||
|
356 | adding a | |||
|
357 | $ touch b | |||
|
358 | $ hg commit -A -m "b" | |||
|
359 | adding b | |||
|
360 | $ touch c | |||
|
361 | $ hg commit -A -m "c" | |||
|
362 | adding c | |||
|
363 | $ hg update -r 1 | |||
|
364 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
365 | $ hg log -G | |||
|
366 | o changeset: 2:991a3460af53 | |||
|
367 | | tag: tip | |||
|
368 | | user: test | |||
|
369 | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
370 | | summary: c | |||
|
371 | | | |||
|
372 | @ changeset: 1:0e067c57feba | |||
|
373 | | user: test | |||
|
374 | | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
375 | | summary: b | |||
|
376 | | | |||
|
377 | o changeset: 0:3903775176ed | |||
|
378 | user: test | |||
|
379 | date: Thu Jan 01 00:00:00 1970 +0000 | |||
|
380 | summary: a | |||
|
381 | ||||
|
382 | $ hg branch dev | |||
|
383 | marked working directory as branch dev | |||
|
384 | (branches are permanent and global, did you want a bookmark?) | |||
|
385 | $ hg update | |||
|
386 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
387 | $ hg summary | |||
|
388 | parent: 1:0e067c57feba | |||
|
389 | b | |||
|
390 | branch: dev | |||
|
391 | commit: (new branch) | |||
|
392 | update: (current) | |||
|
393 | phases: 3 draft |
General Comments 0
You need to be logged in to leave comments.
Login now