Skip to content
Snippets Groups Projects
  • Pierre-Yves David's avatar
    e948ad0dcbe2
    copies: add an devel option to trace all files · e948ad0dcbe2
    Pierre-Yves David authored
    Filelog based copy tracing only trace copy for file that have been added. This
    is a trade off between skipping some rare copy case in exchange for avoiding
    atrocious-to-the-point-of-unusable performance.
    
    The changeset centric copy tracing does not need this trade off and naturally
    trace all copy, include the one involving non-new files.
    
    In order to ease the comparison from both algorithm, we add a small devel option
    to trace copy for all files in the target revisions.
    
    Differential Revision: https://phab.mercurial-scm.org/D9796
    e948ad0dcbe2
    History
    copies: add an devel option to trace all files
    Pierre-Yves David authored
    Filelog based copy tracing only trace copy for file that have been added. This
    is a trade off between skipping some rare copy case in exchange for avoiding
    atrocious-to-the-point-of-unusable performance.
    
    The changeset centric copy tracing does not need this trade off and naturally
    trace all copy, include the one involving non-new files.
    
    In order to ease the comparison from both algorithm, we add a small devel option
    to trace copy for all files in the target revisions.
    
    Differential Revision: https://phab.mercurial-scm.org/D9796
test-copy.t 8.69 KiB
  $ mkdir part1
  $ cd part1

  $ hg init
  $ echo a > a
  $ hg add a
  $ hg commit -m "1"
  $ hg status
  $ hg copy a b
  $ hg --config ui.portablefilenames=abort copy a con.xml
  abort: filename contains 'con', which is reserved on Windows: con.xml
  [10]
  $ hg status
  A b
  $ hg sum
  parent: 0:c19d34741b0a tip
   1
  branch: default
  commit: 1 copied
  update: (current)
  phases: 1 draft
  $ hg --debug commit -m "2"
  committing files:
  b
   b: copy a:b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
  committing manifest
  committing changelog
  updating the branch cache
  committed changeset 1:93580a2c28a50a56f63526fb305067e6fbf739c4

we should see two history entries

  $ hg history -v
  changeset:   1:93580a2c28a5
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  files:       b
  description:
  2
  
  
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  files:       a
  description:
  1
  
  

we should see one log entry for a

  $ hg log a
  changeset:   0:c19d34741b0a
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     1
  

this should show a revision linked to changeset 0

  $ hg debugindex a
     rev linkrev nodeid       p1           p2
       0       0 b789fdd96dc2 000000000000 000000000000

we should see one log entry for b

  $ hg log b
  changeset:   1:93580a2c28a5