comparison tests/test-topic.t @ 1885:d49f75eab6a3

topic: take topic in account for all branch head computation This changeset introduce a "topicmap" that is tracking not just the head of all branches, but the heads of all branch+topic pair. Including the head of the part of the branch without any topic. In practice this means that BRANCHNAME now resolve to the tipmost part for the branch without topic and impact various other logic like head checking during push and default destination for update and merge (these aspect will need adjustment in later changesets). The on-the-fly-temporary-monkey-patching process is pretty horrible, but allow to move forward without waiting on having core patched. We use 'branch:topic' as the branchmap key, this is a small and easy hack that help use a lot for (future) support of heads discovery/checking and on disc cache. I'm not sure it is worthwhile to improve this until an implementation into core. Note that this changeset change the branchmap in all cases, including during exchange, see next changeset for improved behavior. We also currently have the on-disk cache disabled because the core branchmap is lacking phase information in its cache key. This will get done in a later changesets
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 12 Mar 2016 15:36:17 +0000
parents ec28b6c3414a
children c8e4c6e03957
comparison
equal deleted inserted replaced
1884:8a53f99d9061 1885:d49f75eab6a3
73 $ hg topics 73 $ hg topics
74 * fran 74 * fran
75 narf 75 narf
76 $ echo >> fran work >> beta 76 $ echo >> fran work >> beta
77 $ hg ci -m 'start on fran' 77 $ hg ci -m 'start on fran'
78 created new head
79 $ hg co narf 78 $ hg co narf
80 switching to topic narf 79 switching to topic narf
81 2 files updated, 0 files merged, 0 files removed, 0 files unresolved 80 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 $ hg topic 81 $ hg topic
83 fran 82 fran
84 * narf 83 * narf
85 $ hg log -r . -T '{topics}\n' 84 $ hg log -r . -T '{topics}\n'
86 narf 85 narf
87 $ echo 'narf!!!' >> alpha 86 $ echo 'narf!!!' >> alpha
88 $ hg ci -m 'narf!' 87 $ hg ci -m 'narf!'
88 created new head
89 $ hg log -G 89 $ hg log -G
90 @ changeset: 6:7c34953036d6 90 @ changeset: 6:7c34953036d6
91 | tag: tip 91 | tag: tip
92 | topic: narf 92 | topic: narf
93 | parent: 4:fb147b0b417c 93 | parent: 4:fb147b0b417c
285 $ hg co query 285 $ hg co query
286 switching to topic query 286 switching to topic query
287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved 287 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 $ echo answer >> alpha 288 $ echo answer >> alpha
289 $ hg ci -m 'Narf is like `zort` or `poit`!' 289 $ hg ci -m 'Narf is like `zort` or `poit`!'
290 created new head
290 $ hg merge narf 291 $ hg merge narf
291 merging alpha 292 merging alpha
292 warning: conflicts while merging alpha! (edit, then use 'hg resolve --mark') 293 warning: conflicts while merging alpha! (edit, then use 'hg resolve --mark')
293 0 files updated, 0 files merged, 0 files removed, 1 files unresolved 294 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
294 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon 295 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
296 $ hg revert -r narf alpha 297 $ hg revert -r narf alpha
297 $ hg resolve -m alpha 298 $ hg resolve -m alpha
298 (no more unresolved files) 299 (no more unresolved files)
299 $ hg topic narf 300 $ hg topic narf
300 $ hg ci -m 'Finish narf' 301 $ hg ci -m 'Finish narf'
302 created new head
301 $ hg topics 303 $ hg topics
302 fran 304 fran
303 * narf 305 * narf
304 query 306 query
305 $ hg debugnamecomplete 307 $ hg debugnamecomplete # branch:topic here is a buggy side effect
306 default 308 default
309 default:fran
310 default:narf
311 default:query
307 fran 312 fran
308 narf 313 narf
309 query 314 query
310 tip 315 tip
311 $ hg phase --public narf 316 $ hg phase --public narf
379 searching for changes 384 searching for changes
380 adding changesets 385 adding changesets
381 adding manifests 386 adding manifests
382 adding file changes 387 adding file changes
383 added 1 changesets with 1 changes to 1 files (+1 heads) 388 added 1 changesets with 1 changes to 1 files (+1 heads)
384 (run 'hg heads' to see heads, 'hg merge' to merge) 389 (run 'hg heads' to see heads)
385 $ hg topics 390 $ hg topics
386 fran 391 fran
387 * query 392 * query
388 $ hg log -Gr 'draft()' 393 $ hg log -Gr 'draft()'
389 o changeset: 9:0469d521db49 394 o changeset: 9:0469d521db49
511 $ hg topics 516 $ hg topics
512 * fran 517 * fran
513 $ hg topics --clear 518 $ hg topics --clear
514 $ echo fran? >> beta 519 $ echo fran? >> beta
515 $ hg ci -m 'fran?' 520 $ hg ci -m 'fran?'
521 created new head
516 $ hg log -Gr 'draft()' 522 $ hg log -Gr 'draft()'
517 @ changeset: 10:4073470c35e1 523 @ changeset: 10:4073470c35e1
518 | tag: tip 524 | tag: tip
519 | user: test 525 | user: test
520 | date: Thu Jan 01 00:00:00 1970 +0000 526 | date: Thu Jan 01 00:00:00 1970 +0000