view tests/test-convert-svn-tags.t @ 23996:0188c2d90356

trydiff: check only if added file is a copy target, not source When creating a diff with copy/rename enabled, we consider added files and check if they are either copy sources or targets. However, an added file should never be a copy source. The test suite seems to agree with this: all tests pass if we raise an exception when an added file is a copy source. So, let's simplify the code by dropping the conditions that are never true. For those interested in the historical reasons: Before commit d1f209bb9564 (patch: separate reverse copy data (issue1959), 2010-02-11), 'copy' seems to have been a bidirectional map. Then that commit split it up into two unidirectional maps and duplicated the logic to look in both maps. It was still needed at that point to look in both maps, as the copy detection was poor and could sometimes be reported in reverse. A little later came 91eb4512edd0 (copies: rewrite copy detection for non-merge users, 2012-01-04). That commit fixed the copy detection to be backwards when it should, and made the hacks in trydiff unnecessary.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 16 Jan 2015 17:01:58 -0800
parents 7a9cbb315d84
children
line wrap: on
line source

#require svn svn-bindings

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > convert =
  > EOF

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

Convert
  $ hg convert --datesort svn-repo A-hg
  initializing destination A-hg repository
  scanning source...
  sorting...
  converting...
  5 init projA
  4 adda
  3 changea
  2 changea2
  1 changea3
  0 changea
  updating tags

  $ cd A-hg
  $ hg log -G --template '{rev} {desc|firstline} tags: {tags}\n'
  o  6 update tags tags: tip
  |
  o  5 changea tags: trunk.goodtag
  |
  o  4 changea3 tags:
  |
  o  3 changea2 tags: trunk.v1
  |
  o  2 changea tags:
  |
  o  1 adda tags:
  |
  o  0 init projA tags:
  

  $ hg tags -q
  tip
  trunk.goodtag
  trunk.v1

  $ cd ..

Convert without tags

  $ hg convert --datesort --config convert.svn.tags= svn-repo A-notags-hg
  initializing destination A-notags-hg repository
  scanning source...
  sorting...
  converting...
  5 init projA
  4 adda
  3 changea
  2 changea2
  1 changea3
  0 changea

  $ hg -R A-notags-hg tags -q
  tip