changeset 8887:0332f8b44e54

convert/svn: test svn tags encoding
author Patrick Mezard <pmezard@gmail.com>
date Sun, 21 Jun 2009 23:17:05 +0200
parents 0593c5b5b1f0
children bd93d0e0d317
files hgext/convert/common.py tests/svn/encoding.svndump tests/svn/svndump-encoding.sh tests/test-convert-svn-encoding tests/test-convert-svn-encoding.out
diffstat 5 files changed, 81 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/common.py	Sun Jun 21 23:17:02 2009 +0200
+++ b/hgext/convert/common.py	Sun Jun 21 23:17:05 2009 +0200
@@ -103,7 +103,10 @@
         raise NotImplementedError()
 
     def gettags(self):
-        """Return the tags as a dictionary of name: revision"""
+        """Return the tags as a dictionary of name: revision
+
+        Tag names must be UTF-8 strings.
+        """
         raise NotImplementedError()
 
     def recode(self, s, encoding=None):
@@ -198,7 +201,9 @@
 
     def puttags(self, tags):
         """Put tags into sink.
-        tags: {tagname: sink_rev_id, ...}"""
+
+        tags: {tagname: sink_rev_id, ...} where tagname is an UTF-8 string.
+        """
         raise NotImplementedError()
 
     def setbranch(self, branch, pbranches):
--- a/tests/svn/encoding.svndump	Sun Jun 21 23:17:02 2009 +0200
+++ b/tests/svn/encoding.svndump	Sun Jun 21 23:17:05 2009 +0200
@@ -1,6 +1,6 @@
 SVN-fs-dump-format-version: 2
 
-UUID: 7ec0009b-ac71-43a6-9416-7fc295ee5ca1
+UUID: afeb9c47-92ff-4c0c-9f72-e1f6eb8ac9af
 
 Revision-number: 0
 Prop-content-length: 56
@@ -9,7 +9,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:22.535630Z
+2009-06-21T16:34:55.835945Z
 PROPS-END
 
 Revision-number: 1
@@ -27,7 +27,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:22.584588Z
+2009-06-21T16:34:55.909545Z
 PROPS-END
 
 Node-path: branches
@@ -72,7 +72,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:23.143007Z
+2009-06-21T16:34:56.150049Z
 PROPS-END
 
 Node-path: trunk/à
@@ -125,7 +125,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:26.088415Z
+2009-06-21T16:34:59.089402Z
 PROPS-END
 
 Node-path: trunk/è
@@ -167,7 +167,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:27.162784Z
+2009-06-21T16:35:00.165121Z
 PROPS-END
 
 Node-path: trunk/è
@@ -193,7 +193,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:30.079728Z
+2009-06-21T16:35:03.079138Z
 PROPS-END
 
 Node-path: branches/branché
@@ -218,7 +218,7 @@
 K 8
 svn:date
 V 27
-2009-06-21T15:50:33.072456Z
+2009-06-21T16:35:06.060801Z
 PROPS-END
 
 Node-path: branches/branchée
@@ -228,3 +228,53 @@
 Node-copyfrom-path: branches/branché
 
 
+Revision-number: 7
+Prop-content-length: 110
+Content-length: 110
+
+K 7
+svn:log
+V 9
+tag trunk
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2009-06-21T16:35:09.061530Z
+PROPS-END
+
+Node-path: tags/branché
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 6
+Node-copyfrom-path: trunk
+
+
+Revision-number: 8
+Prop-content-length: 114
+Content-length: 114
+
+K 7
+svn:log
+V 12
+tag branché
+K 10
+svn:author
+V 7
+pmezard
+K 8
+svn:date
+V 27
+2009-06-21T16:35:11.068562Z
+PROPS-END
+
+Node-path: tags/branchée
+Node-kind: dir
+Node-action: add
+Node-copyfrom-rev: 6
+Node-copyfrom-path: branches/branchée
+
+
--- a/tests/svn/svndump-encoding.sh	Sun Jun 21 23:17:02 2009 +0200
+++ b/tests/svn/svndump-encoding.sh	Sun Jun 21 23:17:05 2009 +0200
@@ -45,6 +45,13 @@
 svn cp branches/branché branches/branchée
 echo a >> branches/branché/a
 svn ci -m 'branch to branchée'
+
+# Create tag with weird name
+svn up
+svn cp trunk tags/branché
+svn ci -m 'tag trunk'
+svn cp branches/branchée tags/branchée
+svn ci -m 'tag branché'
 cd ..
 
 svnadmin dump svn-repo > ../encoding.svndump
--- a/tests/test-convert-svn-encoding	Sun Jun 21 23:17:02 2009 +0200
+++ b/tests/test-convert-svn-encoding	Sun Jun 21 23:17:05 2009 +0200
@@ -10,4 +10,8 @@
 
 echo '% convert while testing all possible outputs'
 hg --debug convert svn-repo A-hg > /dev/null
-
+cd A-hg
+hg up
+echo '% check tags are in UTF-8'
+python -c "print '\n'.join([('%r' % l) for l in file('.hgtags', 'rb').readlines()])"
+cd ..
--- a/tests/test-convert-svn-encoding.out	Sun Jun 21 23:17:02 2009 +0200
+++ b/tests/test-convert-svn-encoding.out	Sun Jun 21 23:17:05 2009 +0200
@@ -1,1 +1,5 @@
 % convert while testing all possible outputs
+1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% check tags are in UTF-8
+'1c1b4062874e8197a68e7ce9e498479a37d0215c branch\xc3\xa9e\n'
+'edc96568720ef79eefa6372677b18d855de3abee branch\xc3\xa9\n'