##// END OF EJS Templates
merge with stable
Martin Geisler -
r12261:fac20d9b merge default
parent child Browse files
Show More
@@ -83,6 +83,8 b' class darcs_source(converter_source, com'
83 shutil.rmtree(self.tmppath, ignore_errors=True)
83 shutil.rmtree(self.tmppath, ignore_errors=True)
84
84
85 def xml(self, cmd, **kwargs):
85 def xml(self, cmd, **kwargs):
86 # NOTE: darcs is currently encoding agnostic and will print
87 # patch metadata byte-for-byte, even in the XML changelog.
86 etree = ElementTree()
88 etree = ElementTree()
87 fp = self._run(cmd, **kwargs)
89 fp = self._run(cmd, **kwargs)
88 etree.parse(fp)
90 etree.parse(fp)
@@ -107,8 +109,12 b' class darcs_source(converter_source, com'
107 elt = self.changes[rev]
109 elt = self.changes[rev]
108 date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
110 date = util.strdate(elt.get('local_date'), '%a %b %d %H:%M:%S %Z %Y')
109 desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
111 desc = elt.findtext('name') + '\n' + elt.findtext('comment', '')
110 return commit(author=elt.get('author'), date=util.datestr(date),
112 # etree can return unicode objects for name, comment, and author,
111 desc=desc.strip(), parents=self.parents[rev])
113 # so recode() is used to ensure str objects are emitted.
114 return commit(author=self.recode(elt.get('author')),
115 date=util.datestr(date),
116 desc=self.recode(desc).strip(),
117 parents=self.parents[rev])
112
118
113 def pull(self, rev):
119 def pull(self, rev):
114 output, status = self.run('pull', self.path, all=True,
120 output, status = self.run('pull', self.path, all=True,
@@ -56,13 +56,18 b' darcs remove dir/d2'
56 rm dir/d2
56 rm dir/d2
57 darcs mv dir dir2
57 darcs mv dir dir2
58 darcs record -a -l -m p3
58 darcs record -a -l -m p3
59 cd ..
59
60 echo % test utf-8 commit message and author
61 echo g > g
62 # darcs is encoding agnostic, so it takes whatever bytes it's given
63 darcs record -a -l -m 'p4: desc ñ' -A 'author ñ'
60
64
61 glog()
65 glog()
62 {
66 {
63 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
67 HGENCODING=utf-8 hg glog --template '{rev} "{desc|firstline}" ({author}) files: {files}\n' "$@"
64 }
68 }
65
69
70 cd ..
66 hg convert darcs-repo darcs-repo-hg
71 hg convert darcs-repo darcs-repo-hg
67 # The converter does not currently handle patch conflicts very well.
72 # The converter does not currently handle patch conflicts very well.
68 # When they occur, it reverts *all* changes and moves forward,
73 # When they occur, it reverts *all* changes and moves forward,
@@ -12,26 +12,32 b' Finished pulling and applying.'
12 Finished recording patch 'p2'
12 Finished recording patch 'p2'
13 % test file and directory move
13 % test file and directory move
14 Finished recording patch 'p3'
14 Finished recording patch 'p3'
15 % test utf-8 commit message and author
16 Finished recording patch 'p4: desc ñ'
15 initializing destination darcs-repo-hg repository
17 initializing destination darcs-repo-hg repository
16 scanning source...
18 scanning source...
17 sorting...
19 sorting...
18 converting...
20 converting...
19 4 p0
21 5 p0
20 3 p1.2
22 4 p1.2
21 2 p1.1
23 3 p1.1
22 1 p2
24 2 p2
23 0 p3
25 1 p3
24 o 4 "p3" files: dir/d dir/d2 dir2/d f ff
26 0 p4: desc ?
27 o 5 "p4: desc ñ" (author ñ) files: g
25 |
28 |
26 o 3 "p2" files: a dir/d dir/d2 f
29 o 4 "p3" (test@example.org) files: dir/d dir/d2 dir2/d f ff
27 |
30 |
28 o 2 "p1.1" files:
31 o 3 "p2" (test@example.org) files: a dir/d dir/d2 f
29 |
32 |
30 o 1 "p1.2" files: a b
33 o 2 "p1.1" (test@example.org) files:
31 |
34 |
32 o 0 "p0" files: a
35 o 1 "p1.2" (test@example.org) files: a b
36 |
37 o 0 "p0" (test@example.org) files: a
33
38
34 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
39 7225b30cdf38257d5cc7780772c051b6f33e6d6b 644 a
35 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
40 1e88685f5ddec574a34c70af492f95b6debc8741 644 b
36 37406831adc447ec2385014019599dfec953c806 644 dir2/d
41 37406831adc447ec2385014019599dfec953c806 644 dir2/d
37 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
42 b783a337463792a5c7d548ad85a7d3253c16ba8c 644 ff
43 0973eb1b2ecc4de7fafe7447ce1b7462108b4848 644 g
General Comments 0
You need to be logged in to leave comments. Login now