view tests/test-convert-bzr-treeroot.t @ 28335:515018f64c41

tests: Solaris cp doesn't support the -T option The treemanifest tests use the -T option to cp in order to ensure that the two directories named on the commandline are treated as peers, rather than the usual behavior when the final argument is a directory. GNU cp has this option, but other implementations may not. Thankfully, there's no pressing reason to use it. We can simply copy the contents of the first directory into the target directory, since we know that the target directory already exists.
author Danek Duvall <danek.duvall@oracle.com>
date Wed, 02 Mar 2016 14:50:37 -0800
parents 89872688893f
children 75be14993fda
line wrap: on
line source

#require bzr

  $ . "$TESTDIR/bzr-definitions"
  $ cat > treeset.py <<EOF
  > import sys
  > from bzrlib import workingtree
  > wt = workingtree.WorkingTree.open('.')
  > 
  > message, rootid = sys.argv[1:]
  > wt.set_root_id('tree_root-%s' % rootid)
  > wt.commit(message)
  > EOF

change the id of the tree root

  $ mkdir test-change-treeroot-id
  $ cd test-change-treeroot-id
  $ bzr init -q source
  $ cd source
  $ echo content > file
  $ bzr add -q file
  $ bzr commit -q -m 'Initial add'
  $ python ../../treeset.py 'Changed root' new
  $ cd ..
  $ hg convert source source-hg
  initializing destination source-hg repository
  scanning source...
  sorting...
  converting...
  1 Initial add
  0 Changed root
  $ manifest source-hg tip
  % manifest of tip
  644   file

  $ cd ..