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
1=== modified file 'exporters/darcs/README'
2--- exporters/darcs/README 2009-06-25 22:21:33 +0000
3+++ exporters/darcs/README 2009-09-09 01:12:40 +0000
4@@ -23,13 +23,6 @@
5 Ideally it should work with any fast importer, but actually it has been
6 tested with git fast-import, bzr fast-import and hg fastimport. (These
7 are the three fast-import implementations available ATM.)
8- +
9- hg fastimport needs three patches. While they are not in the upstream,
10- you can get it from my repository using
11-+
12-----
13-$ hg clone static-http://frugalware.org/~vmiklos/hg/hg-fastimport
14-----
15
16 Formats::
17 It supports the 'darcs-2', 'hashed', and 'old-fashioned-inventory' darcs
18@@ -127,16 +120,18 @@
19 Mercurial (Hg) version:
20 ----
21 $ hg version
22-Mercurial Distributed SCM (version 1.2.1)
23-----
24-
25-Strictly speaking this document is a wrong place to talk about enabling
26-hg plugins. However...
27-
28-----
29-$ cat ~/.hgrc
30-[extensions]
31-hgext.fastimport=
32+Mercurial Distributed SCM (version 1.3)
33+----
34+
35+Strictly speaking this document is a wrong place to talk about
36+configuring hg fastimport. However... you will need something like:
37+
38+----
39+$ hg clone http://vc.gerg.ca/hg/pyfastimport
40+$ hg clone http://vc.gerg.ca/hg/hg-fastimport
41+$ sudo ln -s /path/to/pyfastimport/fastimport /usr/lib/python2.6/site-packages/fastimport
42+$ sudo ln -s /path/to/hg-fastimport/hgfastimport /usr/lib/python2.6/site-packages/hgfastimport
43+echo -e "[extensions]\nfastimport = /usr/lib/python2.6/site-packages/hgfastimport" > ~/.hgrc
44 ----
45
46 and once you installed the plugin correctly, you should have something like:
47
48=== modified file 'exporters/darcs/d2x'
49--- exporters/darcs/d2x 2008-11-27 13:36:26 +0000
50+++ exporters/darcs/d2x 2009-09-09 01:12:40 +0000
51@@ -93,7 +93,7 @@
52 hg)
53 hg init
54 darcs-fast-export $* $origin | \
55- hg fastimport /dev/stdin
56+ hg fastimport -
57 esac
58 else
59 case $format in
60
61=== modified file 'exporters/darcs/darcs-fast-import'
62--- exporters/darcs/darcs-fast-import 2009-09-07 22:01:39 +0000
63+++ exporters/darcs/darcs-fast-import 2009-09-09 00:31:07 +0000
64@@ -81,6 +81,11 @@
65 raise Exception(s)
66
67 def get_date(self, ts, tz):
68+ # first fix the case when tz is higher than +1200, as
69+ # darcs won't accept it
70+ if int(tz[:3]) > 12:
71+ ts = str(int(ts) + 60*60*24)
72+ tz = str(int(tz[:3])-24) + tz[3:]
73 # int(ts) is seconds since epoch. Since we're trying to
74 # capture both the absolute time of the commit and the
75 # localtime in the timezone of the committer, we need to turn
76
77=== modified file 'exporters/darcs/t/lib.sh'
78--- exporters/darcs/t/lib.sh 2009-09-07 22:01:39 +0000
79+++ exporters/darcs/t/lib.sh 2009-09-09 01:12:40 +0000
80@@ -150,6 +150,7 @@
81 hg pull ../$1.tmp
82 hg merge
83 echo D > file
84+ hg resolve -m file
85 echo "first line
86 second line
87 third line" | hg commit -l /dev/stdin
88@@ -176,6 +177,8 @@
89 echo test > subdir/file
90 hg add subdir/file
91 hg commit -m "add subdir file"
92+ echo test2 > subdir/file
93+ hg commit -m "commit with weird date" -d "Fri Apr 03 12:38:26 2009 +1300"
94 cd ..
95 }
96 create_git()
97@@ -230,12 +233,14 @@
98
99 diff_importgit()
100 {
101+ test -z "`(cd $1.darcs; darcs diff)`" &&
102 diff --exclude _darcs --exclude .git --exclude '*-darcs-backup*' -Nur $1 $1.darcs
103 return $?
104 }
105
106 diff_importhg()
107 {
108+ test -z "`(cd $1.darcs; darcs diff)`" &&
109 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' --exclude 'hg-export.*' \
110 --exclude '.hgtags' --exclude '*.orig' -Nur $1 $1.darcs
111 return $?
112@@ -243,12 +248,14 @@
113
114 diff_importdarcs()
115 {
116+ test -z "`(cd $1.darcs; darcs diff)`" &&
117 diff --exclude _darcs --exclude '*-darcs-backup*' -Nur $1 $2
118 return $?
119 }
120
121 diff_importbzr()
122 {
123+ test -z "`(cd $1.darcs; darcs diff)`" &&
124 diff --exclude _darcs --exclude .bzr --exclude '*-darcs-backup*' -Nur $1 $1.darcs
125 return $?
126 }
127@@ -264,6 +271,7 @@
128
129 diff_hg()
130 {
131+ hg -R $1.hg update
132 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' -Nur $1.hg $1
133 return $?
134 }
135
136=== modified file 'exporters/darcs/t/test-hg.sh'
137--- exporters/darcs/t/test-hg.sh 2009-08-10 22:19:29 +0000
138+++ exporters/darcs/t/test-hg.sh 2009-09-09 01:12:40 +0000
139@@ -8,7 +8,7 @@
140 hg init
141 cd ..
142 if [ "$1" != "--stdout" ]; then
143- darcs-fast-export test |(cd test.hg; hg fastimport /dev/stdin)
144+ darcs-fast-export test |(cd test.hg; hg fastimport -)
145 diff_hg test
146 exit $?
147 else
148
149=== modified file 'exporters/darcs/t/testimport-hg.sh'
150--- exporters/darcs/t/testimport-hg.sh 2009-08-10 22:19:29 +0000
151+++ exporters/darcs/t/testimport-hg.sh 2009-09-09 01:12:40 +0000
152@@ -8,7 +8,6 @@
153 darcs init
154 cd ..
155 (cd test; $pypath/bzrlib/plugins/fastimport/exporters/hg-fast-export.py -r .) | (cd test.darcs; darcs-fast-import)
156-rm test/{*.orig,hg-export.status}
157 if [ $? != 0 ]; then
158 exit 1
159 fi

Subscribers

People subscribed via source and target branches

to all changes: