dvc

Merge lp:~naesten/dvc/devel into lp:dvc

Proposed by Samuel Bronson
Status: Merged
Merged at revision: not available
Proposed branch: lp:~naesten/dvc/devel
Merge into: lp:dvc
Diff against target: None lines
To merge this branch: bzr merge lp:~naesten/dvc/devel
Reviewer Review Type Date Requested Status
Stefan Reichör Pending
dvc-dev Pending
Review via email: mp+11780@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Samuel Bronson (naesten) wrote :

I fixed xdarcs-diff so that you get a file list and can jump between it and the diffs for the files.

Revision history for this message
Stefan Reichör (stefan-xsteve) wrote :

Hi Samuel!

> You have been requested to review the proposed merge of lp:~naesten/dvc/devel into lp:dvc.
>
> I fixed xdarcs-diff so that you get a file list and can jump between it and the diffs for the files.

Thanks for providing this fix.
I have merged from your branch now.

I hope I did the correct thing since I have not used the launchpad features yet.

Stefan.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lisp/dvc-diff.el'
2--- lisp/dvc-diff.el 2009-08-11 23:53:21 +0000
3+++ lisp/dvc-diff.el 2009-09-11 18:40:25 +0000
4@@ -46,7 +46,7 @@
5
6 (defun dvc-dvc-search-file-in-diff (file)
7 "Default for \"dvc-search-file-in-diff\". Place point on diff hunk for FILE."
8- (re-search-forward (concat "^\\+\\+\\+ \\(b\\|mod\\)/" file "\\(.+[0-9][0-9][0-9][0-9]\\)?$")))
9+ (re-search-forward (concat "^\\+\\+\\+ \\(b\\|mod\\|new-[^/\n]+\\)/" file "\\(.+[0-9][0-9][0-9][0-9]\\)?$")))
10
11 (defun dvc-prepare-changes-buffer (base modified type path dvc)
12 "Create and return a buffer to run command showing diffs.
13@@ -551,7 +551,7 @@
14
15 (defun dvc-diff-find-file-name ()
16 "Same as `diff-find-file-name', but works in more cases."
17- (cond ((re-search-backward "^\\+\\+\\+ \\(mod/\\|b/\\)?\\([^\n]*?\\)\\([ \t].*\\)?$" nil t)
18+ (cond ((re-search-backward "^\\+\\+\\+ \\(mod/\\|b/\\|new-[^/\n]+/\\)?\\([^\n]*?\\)\\([ \t].*\\)?$" nil t)
19 (match-string-no-properties 2))
20 ((not (ewoc-locate dvc-fileinfo-ewoc (point))) ;; the buffer contains no diff
21 "")
22
23=== modified file 'lisp/xdarcs.el'
24--- lisp/xdarcs.el 2008-07-11 18:09:58 +0000
25+++ lisp/xdarcs.el 2009-09-11 18:06:32 +0000
26@@ -31,6 +31,7 @@
27
28 (require 'dvc-core)
29 (require 'dvc-utils)
30+(require 'dvc-diff)
31 (require 'xdarcs-core)
32
33 (defun xdarcs-initialize (&optional dir)
34@@ -255,7 +256,40 @@
35 ;; diff
36 ;; --------------------------------------------------------------------------------
37 (defun xdarcs-parse-diff (changes-buffer)
38- nil)
39+ (save-excursion
40+ (while (re-search-forward
41+ "^diff\\( -[^ ]*\\)* old-[^ ]* new-[^/]*/\\(.*\\)$" nil t)
42+
43+ (let* ((name (match-string-no-properties 2))
44+ ; Darcs does not appear to provide any of this information via
45+ ; "darcs diff". But maybe that won't always be the case?
46+ ; Also, going forwards might help all the diffs to appear...
47+ (added (progn (forward-line 1)
48+ (looking-at "^--- /dev/null")))
49+ (removed (progn (forward-line 1)
50+ (looking-at "^\\+\\+\\+ /dev/null"))))
51+
52+ ; Darcs 2.30, at least, is not putting any blank lines between diffs...
53+ (save-excursion
54+ (forward-line -2)
55+ (if (not (or (looking-back "^$")
56+ (= (point) (point-min))))
57+ (insert "\n")))
58+
59+ (with-current-buffer changes-buffer
60+ (ewoc-enter-last
61+ dvc-fileinfo-ewoc
62+ (make-dvc-fileinfo-legacy
63+ :data (list 'file
64+ name
65+ (cond (added "A")
66+ (removed "D")
67+ (t " "))
68+ (cond ((or added removed) " ")
69+ (t "M"))
70+ " " ; dir. directories are not
71+ ; tracked in git
72+ nil))))))))
73
74 ;;;###autoload
75 (defun xdarcs-dvc-diff (&optional against path dont-switch)

Subscribers

People subscribed via source and target branches

to all changes: