view tests/test-convert-bzr-114.t @ 16363:2cdd7e63211b

parsers: incrementally parse the revlog index in C We only parse entries in a revlog index file when they are actually needed, and cache them when first requested. This makes a huge difference to performance on large revlogs when accessing the tip revision or performing a handful of numeric lookups (very common cases). For instance, "hg --time tip --template {node}" on a tree with 300,000 revs takes 0.15 before, 0.02 after. Even for revlog-intensive operations (e.g. running "hg log" to completion), the lazy approach is about 1% faster than the eager parse_index2.
author Bryan O'Sullivan <bryano@fb.com>
date Thu, 05 Apr 2012 13:00:35 -0700
parents d1f88ae495b4
children 7a9cbb315d84
line wrap: on
line source


  $ "$TESTDIR/hghave" bzr114 || exit 80
  $ . "$TESTDIR/bzr-definitions"

The file/directory replacement can only be reproduced on
bzr >= 1.4. Merge it back in test-convert-bzr-directories once
this version becomes mainstream.
replace file with dir

  $ mkdir test-replace-file-with-dir
  $ cd test-replace-file-with-dir
  $ bzr init -q source
  $ cd source
  $ echo d > d
  $ bzr add -q d
  $ bzr commit -q -m 'add d file'
  $ rm d
  $ mkdir d
  $ bzr add -q d
  $ bzr commit -q -m 'replace with d dir'
  $ echo a > d/a
  $ bzr add -q d/a
  $ bzr commit -q -m 'add d/a'
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  2 add d file
  1 replace with d dir
  0 add d/a
  $ manifest source-hg tip
  % manifest of tip
  644   d/a
  $ cd source-hg
  $ hg update
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ cd ../..