Merge lp:~vmiklos/bzr-fastimport/darcs into lp:~bzr/bzr-fastimport/fastimport.dev

Proposed by Miklos Vajna
Status: Merged
Approved by: Ian Clatworthy
Approved revision: no longer in the revision history of the source branch.
Merged at revision: not available
Proposed branch: lp:~vmiklos/bzr-fastimport/darcs
Merge into: lp:~bzr/bzr-fastimport/fastimport.dev
Diff against target: None lines
To merge this branch: bzr merge lp:~vmiklos/bzr-fastimport/darcs
Reviewer Review Type Date Requested Status
Ian Clatworthy Pending
Review via email: mp+11406@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Miklos Vajna (vmiklos) wrote :

3 new commits:
1) improve the testsuite
2) darcs-fast-import now can import the asciidoc hg repo
3) support for hg 1.3 in d2x

lp:~vmiklos/bzr-fastimport/darcs updated
243. By Ian Clatworthy

merge fixes for darcs-fast-import for better hg 1.3 interoperability

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'exporters/darcs/README'
--- exporters/darcs/README 2009-06-25 22:21:33 +0000
+++ exporters/darcs/README 2009-09-09 01:12:40 +0000
@@ -23,13 +23,6 @@
23 Ideally it should work with any fast importer, but actually it has been23 Ideally it should work with any fast importer, but actually it has been
24 tested with git fast-import, bzr fast-import and hg fastimport. (These24 tested with git fast-import, bzr fast-import and hg fastimport. (These
25 are the three fast-import implementations available ATM.)25 are the three fast-import implementations available ATM.)
26 +
27 hg fastimport needs three patches. While they are not in the upstream,
28 you can get it from my repository using
29+
30----
31$ hg clone static-http://frugalware.org/~vmiklos/hg/hg-fastimport
32----
3326
34Formats::27Formats::
35 It supports the 'darcs-2', 'hashed', and 'old-fashioned-inventory' darcs28 It supports the 'darcs-2', 'hashed', and 'old-fashioned-inventory' darcs
@@ -127,16 +120,18 @@
127Mercurial (Hg) version:120Mercurial (Hg) version:
128----121----
129$ hg version122$ hg version
130Mercurial Distributed SCM (version 1.2.1)123Mercurial Distributed SCM (version 1.3)
131----124----
132125
133Strictly speaking this document is a wrong place to talk about enabling126Strictly speaking this document is a wrong place to talk about
134hg plugins. However...127configuring hg fastimport. However... you will need something like:
135128
136----129----
137$ cat ~/.hgrc130$ hg clone http://vc.gerg.ca/hg/pyfastimport
138[extensions]131$ hg clone http://vc.gerg.ca/hg/hg-fastimport
139hgext.fastimport=132$ sudo ln -s /path/to/pyfastimport/fastimport /usr/lib/python2.6/site-packages/fastimport
133$ sudo ln -s /path/to/hg-fastimport/hgfastimport /usr/lib/python2.6/site-packages/hgfastimport
134echo -e "[extensions]\nfastimport = /usr/lib/python2.6/site-packages/hgfastimport" > ~/.hgrc
140----135----
141136
142and once you installed the plugin correctly, you should have something like:137and once you installed the plugin correctly, you should have something like:
143138
=== modified file 'exporters/darcs/d2x'
--- exporters/darcs/d2x 2008-11-27 13:36:26 +0000
+++ exporters/darcs/d2x 2009-09-09 01:12:40 +0000
@@ -93,7 +93,7 @@
93 hg)93 hg)
94 hg init94 hg init
95 darcs-fast-export $* $origin | \95 darcs-fast-export $* $origin | \
96 hg fastimport /dev/stdin96 hg fastimport -
97 esac97 esac
98else98else
99 case $format in99 case $format in
100100
=== modified file 'exporters/darcs/darcs-fast-import'
--- exporters/darcs/darcs-fast-import 2009-09-07 22:01:39 +0000
+++ exporters/darcs/darcs-fast-import 2009-09-09 00:31:07 +0000
@@ -81,6 +81,11 @@
81 raise Exception(s)81 raise Exception(s)
8282
83 def get_date(self, ts, tz):83 def get_date(self, ts, tz):
84 # first fix the case when tz is higher than +1200, as
85 # darcs won't accept it
86 if int(tz[:3]) > 12:
87 ts = str(int(ts) + 60*60*24)
88 tz = str(int(tz[:3])-24) + tz[3:]
84 # int(ts) is seconds since epoch. Since we're trying to89 # int(ts) is seconds since epoch. Since we're trying to
85 # capture both the absolute time of the commit and the90 # capture both the absolute time of the commit and the
86 # localtime in the timezone of the committer, we need to turn91 # localtime in the timezone of the committer, we need to turn
8792
=== modified file 'exporters/darcs/t/lib.sh'
--- exporters/darcs/t/lib.sh 2009-09-07 22:01:39 +0000
+++ exporters/darcs/t/lib.sh 2009-09-09 01:12:40 +0000
@@ -150,6 +150,7 @@
150 hg pull ../$1.tmp150 hg pull ../$1.tmp
151 hg merge151 hg merge
152 echo D > file152 echo D > file
153 hg resolve -m file
153 echo "first line154 echo "first line
154second line155second line
155third line" | hg commit -l /dev/stdin156third line" | hg commit -l /dev/stdin
@@ -176,6 +177,8 @@
176 echo test > subdir/file177 echo test > subdir/file
177 hg add subdir/file178 hg add subdir/file
178 hg commit -m "add subdir file"179 hg commit -m "add subdir file"
180 echo test2 > subdir/file
181 hg commit -m "commit with weird date" -d "Fri Apr 03 12:38:26 2009 +1300"
179 cd ..182 cd ..
180}183}
181create_git()184create_git()
@@ -230,12 +233,14 @@
230233
231diff_importgit()234diff_importgit()
232{235{
236 test -z "`(cd $1.darcs; darcs diff)`" &&
233 diff --exclude _darcs --exclude .git --exclude '*-darcs-backup*' -Nur $1 $1.darcs237 diff --exclude _darcs --exclude .git --exclude '*-darcs-backup*' -Nur $1 $1.darcs
234 return $?238 return $?
235}239}
236240
237diff_importhg()241diff_importhg()
238{242{
243 test -z "`(cd $1.darcs; darcs diff)`" &&
239 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' --exclude 'hg-export.*' \244 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' --exclude 'hg-export.*' \
240 --exclude '.hgtags' --exclude '*.orig' -Nur $1 $1.darcs245 --exclude '.hgtags' --exclude '*.orig' -Nur $1 $1.darcs
241 return $?246 return $?
@@ -243,12 +248,14 @@
243248
244diff_importdarcs()249diff_importdarcs()
245{250{
251 test -z "`(cd $1.darcs; darcs diff)`" &&
246 diff --exclude _darcs --exclude '*-darcs-backup*' -Nur $1 $2252 diff --exclude _darcs --exclude '*-darcs-backup*' -Nur $1 $2
247 return $?253 return $?
248}254}
249255
250diff_importbzr()256diff_importbzr()
251{257{
258 test -z "`(cd $1.darcs; darcs diff)`" &&
252 diff --exclude _darcs --exclude .bzr --exclude '*-darcs-backup*' -Nur $1 $1.darcs259 diff --exclude _darcs --exclude .bzr --exclude '*-darcs-backup*' -Nur $1 $1.darcs
253 return $?260 return $?
254}261}
@@ -264,6 +271,7 @@
264271
265diff_hg()272diff_hg()
266{273{
274 hg -R $1.hg update
267 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' -Nur $1.hg $1275 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' -Nur $1.hg $1
268 return $?276 return $?
269}277}
270278
=== modified file 'exporters/darcs/t/test-hg.sh'
--- exporters/darcs/t/test-hg.sh 2009-08-10 22:19:29 +0000
+++ exporters/darcs/t/test-hg.sh 2009-09-09 01:12:40 +0000
@@ -8,7 +8,7 @@
8hg init8hg init
9cd ..9cd ..
10if [ "$1" != "--stdout" ]; then10if [ "$1" != "--stdout" ]; then
11 darcs-fast-export test |(cd test.hg; hg fastimport /dev/stdin)11 darcs-fast-export test |(cd test.hg; hg fastimport -)
12 diff_hg test12 diff_hg test
13 exit $?13 exit $?
14else14else
1515
=== modified file 'exporters/darcs/t/testimport-hg.sh'
--- exporters/darcs/t/testimport-hg.sh 2009-08-10 22:19:29 +0000
+++ exporters/darcs/t/testimport-hg.sh 2009-09-09 01:12:40 +0000
@@ -8,7 +8,6 @@
8darcs init8darcs init
9cd ..9cd ..
10(cd test; $pypath/bzrlib/plugins/fastimport/exporters/hg-fast-export.py -r .) | (cd test.darcs; darcs-fast-import)10(cd test; $pypath/bzrlib/plugins/fastimport/exporters/hg-fast-export.py -r .) | (cd test.darcs; darcs-fast-import)
11rm test/{*.orig,hg-export.status}
12if [ $? != 0 ]; then11if [ $? != 0 ]; then
13 exit 112 exit 1
14fi13fi

Subscribers

People subscribed via source and target branches

to all changes: