view tests/test-fileset-generated.t @ 23976:344939126579 stable

largefiles: don't interfere with logging normal files The previous code was adding standin files to the matcher's file list when neither the standin file nor the original existed in the context. Somehow, this was confusing the logging code into behaving differently from when the extension wasn't loaded. It seems that this was an attempt to support naming a directory that only contains largefiles, as a test fails if the else clause is dropped entirely. Therefore, only append the "standin" if it is a directory. This was found by running the test suite with --config extensions.largefiles=. The first added test used to log an additional cset that wasn't logged normally. The only relation it had to file 'a' is that 'a' was the source of a move, but it isn't clear why having '.hglf/a' in the list causes this change: @@ -47,6 +47,11 @@ Make sure largefiles doesn't interfere with logging a regular file $ hg log a --config extensions.largefiles= + changeset: 3:2ca5ba701980 + user: test + date: Thu Jan 01 00:00:04 1970 +0000 + summary: d + changeset: 0:9161b9aeaf16 user: test date: Thu Jan 01 00:00:01 1970 +0000 The second added test used to complain about a file not being in the parent revision: @@ -1638,10 +1643,8 @@ Ensure that largefiles doesn't intefere with following a normal file $ hg --config extensions.largefiles= log -f d -T '{desc}' -G - @ c - | - o a - + abort: cannot follow file not in parent revision: ".hglf/d" + [255] $ hg log -f d/a -T '{desc}' -G @ c | Note that there is still something fishy with the largefiles code, because when using a glob pattern like this: $ hg log 'glob:sub/*' the pattern list would contain '.hglf/glob:sub/*'. None of the tests show this (this test lives in test-largefiles.t at 1349), it was just something that I noticed when the code was loaded up with print statements.
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 30 Jan 2015 20:44:11 -0500
parents caff3675cba5
children 5b85a5bc5bbb
line wrap: on
line source

  $ hg init

Set up history and working copy

  $ python $TESTDIR/generate-working-copy-states.py state 2 1
  $ hg addremove -q --similarity 0
  $ hg commit -m first

  $ python $TESTDIR/generate-working-copy-states.py state 2 2
  $ hg addremove -q --similarity 0
  $ hg commit -m second

  $ python $TESTDIR/generate-working-copy-states.py state 2 wc
  $ hg addremove -q --similarity 0
  $ hg forget *_*_*-untracked
  $ rm *_*_missing-*

Test status

  $ hg st -A 'set:modified()'
  M content1_content1_content3-tracked
  M content1_content2_content1-tracked
  M content1_content2_content3-tracked
  M missing_content2_content3-tracked

  $ hg st -A 'set:added()'
  A content1_missing_content1-tracked
  A content1_missing_content3-tracked
  A missing_missing_content3-tracked

  $ hg st -A 'set:removed()'
  R content1_content1_content1-untracked
  R content1_content1_content3-untracked
  R content1_content1_missing-untracked
  R content1_content2_content1-untracked
  R content1_content2_content2-untracked
  R content1_content2_content3-untracked
  R content1_content2_missing-untracked
  R missing_content2_content2-untracked
  R missing_content2_content3-untracked
  R missing_content2_missing-untracked

  $ hg st -A 'set:deleted()'
  ! content1_content1_missing-tracked
  ! content1_content2_missing-tracked
  ! content1_missing_missing-tracked
  ! missing_content2_missing-tracked
  ! missing_missing_missing-tracked

  $ hg st -A 'set:unknown()'
  ? content1_missing_content1-untracked
  ? content1_missing_content3-untracked
  ? missing_missing_content3-untracked

  $ hg st -A 'set:clean()'
  C content1_content1_content1-tracked
  C content1_content2_content2-tracked
  C missing_content2_content2-tracked

Test log

  $ hg log -T '{rev}\n' --stat 'set:modified()'
  1
   content1_content2_content1-tracked |  2 +-
   content1_content2_content3-tracked |  2 +-
   missing_content2_content3-tracked  |  1 +
   3 files changed, 3 insertions(+), 2 deletions(-)
  
  0
   content1_content1_content3-tracked |  1 +
   content1_content2_content1-tracked |  1 +
   content1_content2_content3-tracked |  1 +
   3 files changed, 3 insertions(+), 0 deletions(-)
  
  $ hg log -T '{rev}\n' --stat 'set:added()'
  1
   content1_missing_content1-tracked |  1 -
   content1_missing_content3-tracked |  1 -
   2 files changed, 0 insertions(+), 2 deletions(-)
  
  0
   content1_missing_content1-tracked |  1 +
   content1_missing_content3-tracked |  1 +
   2 files changed, 2 insertions(+), 0 deletions(-)
  
  $ hg log -T '{rev}\n' --stat 'set:removed()'
  1
   content1_content2_content1-untracked |  2 +-
   content1_content2_content2-untracked |  2 +-
   content1_content2_content3-untracked |  2 +-
   content1_content2_missing-untracked  |  2 +-
   missing_content2_content2-untracked  |  1 +
   missing_content2_content3-untracked  |  1 +
   missing_content2_missing-untracked   |  1 +
   7 files changed, 7 insertions(+), 4 deletions(-)
  
  0
   content1_content1_content1-untracked |  1 +
   content1_content1_content3-untracked |  1 +
   content1_content1_missing-untracked  |  1 +
   content1_content2_content1-untracked |  1 +
   content1_content2_content2-untracked |  1 +
   content1_content2_content3-untracked |  1 +
   content1_content2_missing-untracked  |  1 +
   7 files changed, 7 insertions(+), 0 deletions(-)
  
  $ hg log -T '{rev}\n' --stat 'set:deleted()'
  1
   content1_content2_missing-tracked |  2 +-
   content1_missing_missing-tracked  |  1 -
   missing_content2_missing-tracked  |  1 +
   3 files changed, 2 insertions(+), 2 deletions(-)
  
  0
   content1_content1_missing-tracked |  1 +
   content1_content2_missing-tracked |  1 +
   content1_missing_missing-tracked  |  1 +
   3 files changed, 3 insertions(+), 0 deletions(-)
  
  $ hg log -T '{rev}\n' --stat 'set:unknown()'
  1
   content1_missing_content1-untracked |  1 -
   content1_missing_content3-untracked |  1 -
   2 files changed, 0 insertions(+), 2 deletions(-)
  
  0
   content1_missing_content1-untracked |  1 +
   content1_missing_content3-untracked |  1 +
   2 files changed, 2 insertions(+), 0 deletions(-)
  
  $ hg log -T '{rev}\n' --stat 'set:clean()'
  1
   content1_content2_content2-tracked |  2 +-
   missing_content2_content2-tracked  |  1 +
   2 files changed, 2 insertions(+), 1 deletions(-)
  
  0
   content1_content1_content1-tracked |  1 +
   content1_content2_content2-tracked |  1 +
   2 files changed, 2 insertions(+), 0 deletions(-)
  
Test revert

BROKEN: the files that get undeleted were not modified, they were removed,
and content1_content2_missing-tracked was also not modified, it was deleted

  $ hg revert 'set:modified()'
  reverting content1_content1_content3-tracked
  reverting content1_content2_content1-tracked
  undeleting content1_content2_content1-untracked
  undeleting content1_content2_content2-untracked
  reverting content1_content2_content3-tracked
  undeleting content1_content2_content3-untracked
  reverting content1_content2_missing-tracked
  undeleting content1_content2_missing-untracked
  reverting missing_content2_content3-tracked

BROKEN: only the files that get forgotten are correct

  $ hg revert 'set:added()'
  forgetting content1_missing_content1-tracked
  forgetting content1_missing_content3-tracked
  undeleting missing_content2_content2-untracked
  undeleting missing_content2_content3-untracked
  reverting missing_content2_missing-tracked
  undeleting missing_content2_missing-untracked
  forgetting missing_missing_content3-tracked

  $ hg revert 'set:removed()'
  undeleting content1_content1_content1-untracked
  undeleting content1_content1_content3-untracked
  undeleting content1_content1_missing-untracked

  $ hg revert 'set:deleted()'
  reverting content1_content1_missing-tracked
  forgetting content1_missing_missing-tracked
  forgetting missing_missing_missing-tracked

  $ hg revert 'set:unknown()'

  $ hg revert 'set:clean()'