tests/test-update-reverse.t
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Mon, 29 Apr 2013 15:58:15 +0900
branchstable
changeset 19095 5cc71484ee9c
parent 18634 4b5d37ca3c11
child 21391 cb15835456cb
permissions -rw-r--r--
merge: increase safety of parallel updating/removing on icasefs "merge.applyupdates()" sorts "actions" in removal first order, and "workeractions" derived from it should be also sorted. If each actions in "workeractions" are executed in serial, this sorting ensures that merging/updating process is collision free, because updating the file in target context is always executed after removing the existing file which causes case-folding collision against the former. In the other hand, if each actions are executed in parallel, updating on a worker process may be executed before removing on another worker process, because "worker.partition()" partitions list of actions regardless of type of each actions. This patch divides "workeractions" into removing and updating, and executes the former first. This patch still scans "actions"/"workeractions" some times for ease of patch review, even though large list may cost much in this way. (total cost should be as same as before) This also changes some tests, because dividing "workeractions" affects progress indication.

  $ hg init

  $ touch a
  $ hg add a
  $ hg commit -m "Added a"

  $ touch main
  $ hg add main
  $ hg commit -m "Added main"
  $ hg checkout 0
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved

'main' should be gone:

  $ ls
  a

  $ touch side1
  $ hg add side1
  $ hg commit -m "Added side1"
  created new head
  $ touch side2
  $ hg add side2
  $ hg commit -m "Added side2"

  $ hg log
  changeset:   3:91ebc10ed028
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added side2
  
  changeset:   2:b932d7dbb1e1
  parent:      0:c2eda428b523
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added side1
  
  changeset:   1:71a760306caf
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added main
  
  changeset:   0:c2eda428b523
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added a
  

  $ hg heads
  changeset:   3:91ebc10ed028
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added side2
  
  changeset:   1:71a760306caf
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     Added main
  
  $ ls
  a
  side1
  side2

  $ hg update --debug -C 1
  resolving manifests
   branchmerge: False, force: True, partial: False
   ancestor: 91ebc10ed028+, local: 91ebc10ed028+, remote: 71a760306caf
   side1: other deleted -> r
   side2: other deleted -> r
   main: remote created -> g
  removing side1
  removing side2
  updating: side2 2/3 files (66.67%)
  getting main
  updating: main 3/3 files (100.00%)
  1 files updated, 0 files merged, 2 files removed, 0 files unresolved

  $ ls
  a
  main