[issue3048] hg convert from SVN when files copied in svn and renamed in filemap.

Oleksandr Gavenko bugs at mercurial.selenic.com
Fri Oct 14 09:29:06 CDT 2011


New submission from Oleksandr Gavenko <gavenkoa at gmail.com>:

I have SVN project with wrong hierarchy in the past and fidex by
moving files up to one level.

When I convert repo from SVN to HG I want fix histiry by filemap:

  rename wrongpath/ .

SVN history have ./wrongpath/hello.c which lately moved to
./hello.c so after conversion I expect that ./hello.c always stay
in project root and history before and after moving this file in
SVN are joined.

But this is not happen. Look this script:

  #!/bin/sh

  set -x

  svnadmin.exe create svn-repo
  svn co file://$PWD/svn-repo svn-working
  cd svn-working/
  mkdir proj
  touch proj/README
  svn add proj/
  svn ci -m 111 .
  echo xxx>>proj/README
  svn ci -m 222 .
  svn mv proj/README .
  svn ci -m 333 .
  echo yyy>>README
  svn ci -m 444 .
  cd ..
  pwd
  echo rename proj . >filemap.txt
  hg convert --filemap filemap.txt file://$PWD/svn-repo hg-repo
  cd hg-repo
  hg up
  hg log README
  hg log

After run I got:

  $ script -c ./test.sh
  $ cat typescript

  + svnadmin.exe create svn-repo
  + svn co file:///cygdrive/d/home/tmp/test/svn-repo svn-working
  Checked out revision 0.
  + cd svn-working/
  + mkdir proj
  + touch proj/README
  + svn add proj/
  A         proj
  A         proj/README
  + svn ci -m 111 .
  Adding         proj
  Adding         proj/README
  Transmitting file data .
  Committed revision 1.
  + echo xxx
  + svn ci -m 222 .
  Sending        proj/README
  Transmitting file data .
  Committed revision 2.
  + svn mv proj/README .
  A         README
  D         proj/README
  + svn ci -m 333 .
  Adding         README
  Deleting       proj/README

  Committed revision 3.
  + echo yyy
  + svn ci -m 444 .
  Sending        README
  Transmitting file data .
  Committed revision 4.
  + cd ..
  + pwd
  /cygdrive/d/home/tmp/test
  + echo rename proj .
  + hg convert --filemap filemap.txt
file:///cygdrive/d/home/tmp/test/svn-repo hg-repo
  initializing destination hg-repo repository
  scanning source...
  sorting...
  converting...
  3 111
  2 222
  1 333
  0 444
  + cd hg-repo
  + hg up
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  + hg log README
  changeset:   3:1e9db96a2a29
  tag:         tip
  user:        user
  date:        Fri Oct 14 14:20:12 2011 +0000
  files:       README
  description:
  444


  + hg log
  changeset:   3:1e9db96a2a29
  tag:         tip
  user:        user
  date:        Fri Oct 14 14:20:12 2011 +0000
  files:       README
  description:
  444


  changeset:   2:cef4d8991890
  user:        user
  date:        Fri Oct 14 14:20:11 2011 +0000
  files:       README
  description:
  333


  changeset:   1:56d71e8842cd
  user:        user
  date:        Fri Oct 14 14:20:11 2011 +0000
  files:       README
  description:
  222


  changeset:   0:3ca28e7974c7
  user:        user
  date:        Fri Oct 14 14:20:10 2011 +0000
  files:       README
  description:
  111

You can see that "hg log README" have I changeset in history but
I expect to have all 4 changes.

----------
messages: 17637
nosy: gavenkoa
priority: bug
status: unread
title: hg convert from SVN when files copied in svn and renamed in filemap.
topic: convert

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue3048>
____________________________________________________


More information about the Mercurial-devel mailing list