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

Proposed by Miklos Vajna
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 279
Merged at revision: 278
Proposed branch: lp:~vmiklos/bzr-fastimport/darcs
Merge into: lp:bzr-fastimport
Diff against target: 65 lines (+15/-6)
2 files modified
exporters/darcs/darcs-fast-import (+12/-3)
exporters/darcs/t/lib.sh (+3/-3)
To merge this branch: bzr merge lp:~vmiklos/bzr-fastimport/darcs
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
John A Meinel Pending
Review via email: mp+31110@code.launchpad.net

Description of the change

darcs: Fix importing commits with empty commit message.

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'exporters/darcs/darcs-fast-import'
2--- exporters/darcs/darcs-fast-import 2010-06-27 23:21:13 +0000
3+++ exporters/darcs/darcs-fast-import 2010-07-28 01:41:07 +0000
4@@ -155,6 +155,8 @@
5 sock.stdin.close()
6 self.log("Tagging %s:\n%s" % (version, sock.stdout.read()))
7 sock.stdout.close()
8+ if sock.wait() != 0:
9+ self.bug("darcs tag failed: '%s'" % sock.returncode)
10
11 def handle_commit(self):
12 if not self.prevfiles and self.options.import_marks:
13@@ -249,12 +251,19 @@
14 return
15 for i in adds:
16 self.invoke_add(i)
17- sock = subprocess.Popen(["darcs", "record", "--ignore-times", "-a", "--pipe"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
18- buf = [self.date, self.ident, self.short, self.long]
19- sock.stdin.write("\n".join(buf))
20+ args = ["darcs", "record", "--ignore-times", "-a", "--pipe"]
21+ buf = [self.date, self.ident]
22+ if not len(self.short):
23+ args.extend(['-m', ''])
24+ else:
25+ buf.extend([self.short, self.long])
26+ sock = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
27+ sock.stdin.write("\n".join(buf)+"\n")
28 sock.stdin.close()
29 self.log("Recording :%s:\n%s" % (self.mark_num, sock.stdout.read()))
30 sock.stdout.close()
31+ if sock.wait() != 0:
32+ self.bug("darcs record failed: '%s'" % sock.returncode)
33
34 for src, path in symlinks:
35 # symlink does not do what we want if path is
36
37=== modified file 'exporters/darcs/t/lib.sh'
38--- exporters/darcs/t/lib.sh 2010-06-27 23:21:13 +0000
39+++ exporters/darcs/t/lib.sh 2010-07-28 01:41:07 +0000
40@@ -262,7 +262,7 @@
41
42 diff_importhg()
43 {
44- test -z "`(cd $1.darcs; darcs diff)`" &&
45+ cd $1.darcs && test -z "`darcs diff 2>&1`" && cd .. &&
46 diff --exclude _darcs --exclude .hg --exclude '*-darcs-backup*' --exclude 'hg-export.*' \
47 --exclude '.hgtags' --exclude '*.orig' -Nur $1 $1.darcs
48 return $?
49@@ -270,14 +270,14 @@
50
51 diff_importdarcs()
52 {
53- test -z "`(cd $1.darcs; darcs diff)`" &&
54+ cd $1.importdarcs && test -z "`darcs diff 2>&1`" && cd .. &&
55 diff --exclude _darcs --exclude '*-darcs-backup*' -Nur $1 $2
56 return $?
57 }
58
59 diff_importbzr()
60 {
61- test -z "`(cd $1.darcs; darcs diff)`" &&
62+ cd $1.darcs && test -z "`darcs diff 2>&1`" && cd .. &&
63 diff --exclude _darcs --exclude .bzr --exclude '*-darcs-backup*' -Nur $1 $1.darcs
64 return $?
65 }

Subscribers

People subscribed via source and target branches