tests/test-up-local-change.t
author Mads Kiilerich <madski@unity3d.com>
Tue, 22 Apr 2014 02:10:25 +0200
changeset 21391 cb15835456cb
parent 21389 e741972017d9
child 23396 6a254a2dd37c
child 23477 689540e6007e
permissions -rw-r--r--
merge: change debug logging - test output changes but no real changes Preparing for action list split-up, making sure the final change don't have any test changes. The patch moves debug statements around without really changing anything. Arguably, it temporarily makes the code worse. The only justification is that it makes it easier to review the test changes ... and in the end the big change will not change test output at all. The changes to test output are due to changes in the ordering of debug output. That is mainly because we now do the debug logging for files when we actually process them. Files are also processed in a slightly different but still correct order. It is now primarily ordered by action type, secondarily by filename. The patch introduces some redundancy. Some of it will be removed again, some of it will in the end help code readability and efficiency. It is possible that we later on could introduce a "process this action list and do some logging and progress reporting and apply this function". The "preserving X for resolve" debug statements will only have single space indentation. It will no longer have a leading single space indented "f: msg -> m" message. Having this message double indented would thus no longer make sense. The bid actions will temporarily be sorted using a custom sort key that happens to match the sort order the simplified code will have in the end.

  $ HGMERGE=true; export HGMERGE

  $ hg init r1
  $ cd r1
  $ echo a > a
  $ hg addremove
  adding a
  $ hg commit -m "1"

  $ hg clone . ../r2
  updating to branch default
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ../r2
  $ hg up
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo abc > a
  $ hg diff --nodates
  diff -r c19d34741b0a a
  --- a/a
  +++ b/a
  @@ -1,1 +1,1 @@
  -a
  +abc

  $ cd ../r1
  $ echo b > b
  $ echo a2 > a
  $ hg addremove
  adding b
  $ hg commit -m "2"

  $ cd ../r2
  $ hg -q pull ../r1
  $ hg status
  M a
  $ hg parents
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     1
  
  $ hg --debug up
    searching for copies back to rev 1
    unmatched files in other:
     b
  resolving manifests
   branchmerge: False, force: False, partial: False
   ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
   preserving a for resolve of a
   b: remote created -> g
  getting b
  updating: b 1/2 files (50.00%)
   a: versions differ -> m
  updating: a 2/2 files (100.00%)
  picked tool 'true' for a (binary False symlink False)
  merging a
  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
  $ hg parents
  changeset:   1:1e71731e6fbb
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     2
  
  $ hg --debug up 0
  resolving manifests
   branchmerge: False, force: False, partial: False
   ancestor: 1e71731e6fbb, local: 1e71731e6fbb+, remote: c19d34741b0a
   preserving a for resolve of a
   b: other deleted -> r
  removing b
  updating: b 1/2 files (50.00%)
   a: versions differ -> m
  updating: a 2/2 files (100.00%)
  picked tool 'true' for a (binary False symlink False)
  merging a
  my a@1e71731e6fbb+ other a@c19d34741b0a ancestor a@1e71731e6fbb
  0 files updated, 1 files merged, 1 files removed, 0 files unresolved
  $ hg parents
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     1
  
  $ hg --debug merge
  abort: nothing to merge
  (use 'hg update' instead)
  [255]
  $ hg parents
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     1
  
  $ hg --debug up
    searching for copies back to rev 1
    unmatched files in other:
     b
  resolving manifests
   branchmerge: False, force: False, partial: False
   ancestor: c19d34741b0a, local: c19d34741b0a+, remote: 1e71731e6fbb
   preserving a for resolve of a
   b: remote created -> g
  getting b
  updating: b 1/2 files (50.00%)
   a: versions differ -> m
  updating: a 2/2 files (100.00%)
  picked tool 'true' for a (binary False symlink False)
  merging a
  my a@c19d34741b0a+ other a@1e71731e6fbb ancestor a@c19d34741b0a
  1 files updated, 1 files merged, 0 files removed, 0 files unresolved
  $ hg parents
  changeset:   1:1e71731e6fbb
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     2
  
  $ hg -v history
  changeset:   1:1e71731e6fbb
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  files:       a b
  description:
  2
  
  
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  files:       a
  description:
  1
  
  
  $ hg diff --nodates
  diff -r 1e71731e6fbb a
  --- a/a
  +++ b/a
  @@ -1,1 +1,1 @@
  -a2
  +abc


create a second head

  $ cd ../r1
  $ hg up 0
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ echo b2 > b
  $ echo a3 > a
  $ hg addremove
  adding b
  $ hg commit -m "3"
  created new head

  $ cd ../r2
  $ hg -q pull ../r1
  $ hg status
  M a
  $ hg parents
  changeset:   1:1e71731e6fbb
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     2
  
  $ hg --debug up
  abort: uncommitted changes
  (commit and merge, or update --clean to discard changes)
  [255]
  $ hg --debug merge
  abort: uncommitted changes
  (use 'hg status' to list changes)
  [255]
  $ hg --debug merge -f
    searching for copies back to rev 1
    unmatched files new in both:
     b
  resolving manifests
   branchmerge: True, force: True, partial: False
   ancestor: c19d34741b0a, local: 1e71731e6fbb+, remote: 83c51d0caff4
   preserving a for resolve of a
   preserving b for resolve of b
   a: versions differ -> m
  updating: a 1/2 files (50.00%)
  picked tool 'true' for a (binary False symlink False)
  merging a
  my a@1e71731e6fbb+ other a@83c51d0caff4 ancestor a@c19d34741b0a
   b: versions differ -> m
  updating: b 2/2 files (100.00%)
  picked tool 'true' for b (binary False symlink False)
  merging b
  my b@1e71731e6fbb+ other b@83c51d0caff4 ancestor b@000000000000
  0 files updated, 2 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)
  $ hg parents
  changeset:   1:1e71731e6fbb
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     2
  
  changeset:   2:83c51d0caff4
  tag:         tip
  parent:      0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     3
  
  $ hg diff --nodates
  diff -r 1e71731e6fbb a
  --- a/a
  +++ b/a
  @@ -1,1 +1,1 @@
  -a2
  +abc


test a local add

  $ cd ..
  $ hg init a
  $ hg init b
  $ echo a > a/a
  $ echo a > b/a
  $ hg --cwd a commit -A -m a
  adding a
  $ cd b
  $ hg add a
  $ hg pull -u ../a
  pulling from ../a
  requesting all changes
  adding changesets
  adding manifests
  adding file changes
  added 1 changesets with 1 changes to 1 files
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ hg st

  $ cd ..