Mercurial > hg
comparison tests/test-newbranch.t @ 28903:e1dd0de26557
update: fix bare update to work on new branch
So far bare update on new branch results in
'abort: branch new-branch not found'. This commit fixes
this by updating to the parent of wctx.
The effect of updating to the parent of wctx is to move to the paren't
branch - this means that it is no longer necessary to prevent you from
updating if you would lose your newly created branch.
author | liscju <piotr.listkiewicz@gmail.com> |
---|---|
date | Tue, 05 Apr 2016 06:53:33 +0200 |
parents | 701df761aa94 |
children | d9539959167d |
comparison
equal
deleted
inserted
replaced
28902:eb017d52899d | 28903:e1dd0de26557 |
---|---|
209 | 209 |
210 $ hg branch foobar | 210 $ hg branch foobar |
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 |
219 $ hg branch ff | 218 $ hg branch ff |
220 marked working directory as branch ff | 219 marked working directory as branch ff |
343 $ hg merge | 342 $ hg merge |
344 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | 343 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
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 |