view tests/test-convert-svn-startrev.t @ 30449:a31634336471

drawdag: update test repos by drawing the changelog DAG in ASCII Currently, we have "debugbuilddag" which is a powerful tool to build test cases but not intuitive. We may end up running "hg log" in the test to make the test more readable. This patch adds a "drawdag" extension with a "debugdrawdag" command for similar testing purpose. Unlike the cryptic "debugbuilddag" command, it reads an ASCII graph that is intuitive to human, so the test case can be more readable. Unlike "debugbuilddag", "drawdag" does not require an empty repo. So it can be used to add new changesets to an existing repo. Since the "drawdag" logic is not that trivial and only makes sense for testing purpose, the extension is added to the "tests" directory, to make the core logic clean. If we find it useful (for example, to demonstrate cases and help user understand some cases) and want to ship it by default in the future, we can move it to a ship-by-default "debugdrawdag" at that time.
author Jun Wu <quark@fb.com>
date Wed, 09 Nov 2016 16:01:34 +0000
parents 7a9cbb315d84
children
line wrap: on
line source

#require svn svn-bindings

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > convert =
  > EOF
  $ convert()
  > {
  >     startrev=$1
  >     repopath=A-r$startrev-hg
  >     hg convert --config convert.svn.startrev=$startrev \
  >         --config convert.svn.trunk=branches/branch1 \
  >         --config convert.svn.branches="  " \
  >         --config convert.svn.tags= \
  >         --datesort svn-repo $repopath
  >     hg -R $repopath log -G \
  >         --template '{rev} {desc|firstline} files: {files}\n'
  >     echo
  > }

  $ svnadmin create svn-repo
  $ svnadmin load -q svn-repo < "$TESTDIR/svn/startrev.svndump"

Convert before branching point

  $ convert 3
  initializing destination A-r3-hg repository
  scanning source...
  sorting...
  converting...
  3 removeb
  2 changeaa
  1 branch, changeaaa
  0 addc,changeaaaa
  o  3 addc,changeaaaa files: a c
  |
  o  2 branch, changeaaa files: a
  |
  o  1 changeaa files: a
  |
  o  0 removeb files: a
  
  

Convert before branching point

  $ convert 4
  initializing destination A-r4-hg repository
  scanning source...
  sorting...
  converting...
  2 changeaa
  1 branch, changeaaa
  0 addc,changeaaaa
  o  2 addc,changeaaaa files: a c
  |
  o  1 branch, changeaaa files: a
  |
  o  0 changeaa files: a
  
  

Convert at branching point

  $ convert 5
  initializing destination A-r5-hg repository
  scanning source...
  sorting...
  converting...
  1 branch, changeaaa
  0 addc,changeaaaa
  o  1 addc,changeaaaa files: a c
  |
  o  0 branch, changeaaa files: a
  
  

Convert last revision only

  $ convert 6
  initializing destination A-r6-hg repository
  scanning source...
  sorting...
  converting...
  0 addc,changeaaaa
  o  0 addc,changeaaaa files: a c