>>>>> "vila" == Vincent LADEUIL <[EMAIL PROTECTED]> writes:
>>>>> "Stefan" == Stefan Reichör <[EMAIL PROTECTED]> writes:
Stefan> Vincent LADEUIL <[EMAIL PROTECTED]> writes: I would
Stefan> rather reuse dvc-partner-buffer instead of the new
Stefan> variable you introduced.
>>> >> I didn't catch that one and reading the code I don't
>>> >> really understand how to do that, but feel free to do
>>> it, >> I'll learn by reading your code :-)
>>>
Stefan> I will do so in the next days...
>>> Ok. I will continue to test my patch in the mean time :)
Stefan> I have implemented a way to show the files to commit
Stefan> in
Stefan> [EMAIL PROTECTED]
Stefan> I will play a bit with it. Could you please test it
Stefan> also.
vila> Oh yes, with great pleasure !
vila> ....
vila> Can you just tell me how I can get my hands on it ?
With the help of Google I managed to get your files.
May be you have sent me an answer but my wonderful postmaster
have actually 300 mails blocked somewhere and don't know how to
recover them... so I followup to myself (from now on, your mails
should come thru).
Stefan> I will activate the code, when I think it is working
Stefan> well enough.
I have activated/patched/tested the following.
I think some refactoring still need to be done (dvc-diff and
dvc-status should use the same variable to store the marked
files).
I disagree with dvc-get-current-file-list returning the file at
point. If the user wants to commit a single file he can mark it
before. I thought I understood that the rule should be to commit
everything, selected commit being the exception. Returning the
current file at that point reverse that rule/exception paradigm.
I leave the all-if-none-marked option active because it's still
needed to display which files will be committed but I don't use it
when committing.
Vincent
* looking for [EMAIL PROTECTED] to compare with
* comparing to [EMAIL PROTECTED]: .... done.
M lisp/bzr-dvc.el
M lisp/bzr.el
M lisp/dvc-core.el
M lisp/dvc-log.el
* modified files
--- orig/lisp/bzr-dvc.el
+++ mod/lisp/bzr-dvc.el
@@ -61,7 +61,8 @@
(defun bzr-dvc-files-to-commit ()
;;todo: set the correct modifier, one of dvc-modified, dvc-added, dvc-move,
now use only nil
(let ((files
- (with-current-buffer dvc-partner-buffer (dvc-current-file-list t))))
+ (with-current-buffer dvc-partner-buffer
+ (dvc-get-current-file-list t))))
(mapcar (lambda (arg) (cons nil arg)) files)))
(provide 'bzr-dvc)
--- orig/lisp/bzr.el
+++ mod/lisp/bzr.el
@@ -192,20 +192,14 @@
(let ((buffer (find-file-noselect (dvc-log-edit-file-name))))
(save-buffer buffer)
(dvc-run-dvc-async
- 'bzr (list "commit" "--verbose" "--file" (dvc-log-edit-file-name))
-;; Patch from Vincent LADEUIL, not yet activated
-;; + 'bzr
-;; + (append
-;; + (list "commit" "--verbose" "--file" (dvc-log-edit-file-name))
-;; + ;; Get marked files to do a selected file commit. Nil
-;; + ;; otherwise (which means commit all files).
-;; + (when (buffer-live-p dvc-log-source-buffer)
-;; + (with-current-buffer dvc-log-source-buffer
-;; + dvc-buffer-marked-file-list)
-;; + ))
-;; use: (with-current-buffer dvc-partner-buffer (dvc-current-file-list t))
- :finished (dvc-capturing-lambda
- (output error status arguments)
+ ;; Patch from Vincent LADEUIL, activated
+ 'bzr
+ (append
+ (list "commit" "--verbose" "--file" (dvc-log-edit-file-name))
+ ;; Get marked files to do a selected file commit. Nil
+ ;; otherwise (which means commit all files).
+ (with-current-buffer dvc-partner-buffer (dvc-get-current-file-list)))
+ :finished (dvc-capturing-lambda (output error status arguments)
(dvc-show-error-buffer output 'commit)
(let ((inhibit-read-only t))
(goto-char (point-max))
--- orig/lisp/dvc-core.el
+++ mod/lisp/dvc-core.el
@@ -142,7 +142,8 @@
(defvar dvc-current-file-list nil
"A buffer specific list of files for a dvc operation.")
-(defun dvc-current-file-list (&optional all-if-none-marked)
+
+(defun dvc-get-current-file-list (&optional all-if-none-marked)
"Return a list of currently active files.
The following sources are tried (in that order) and used if they are non nil:
@@ -151,16 +152,18 @@
* `dvc-current-file-list'
* When in dired mode, return the marked files or the file where point is
* When ALL-IF-NONE-MARKED is t, return all files from that buffer. That is not
yet implemented. Just returns nil at the moment..
-* Otherwise call the function `dvc-get-file-info-at-point'."
- (cond (dvc-buffer-marked-file-list
+* Otherwise nil is returned (the dvc backend should know what to do)."
+ ;; TODO: dvc-diff and dvc-status should use the same variable
+ ;; to store the marked files
+ (cond (dvc-buffer-marked-file-list ;; dvc-diff
dvc-buffer-marked-file-list)
- (dvc-current-file-list
+ (dvc-current-file-list ;; dvc-status
dvc-current-file-list)
((eq major-mode 'dired-mode)
(dired-map-over-marks (dired-get-filename) nil))
(all-if-none-marked
nil) ;; TODO: get a list off all available files of that buffer
- (t (list (dvc-get-file-info-at-point)))))
+ (t nil))) ;; If no files are marked, leaves the backend choose the
files
(defun dvc-confirm-read-file-name (prompt &optional mustmatch file)
(unless file
--- orig/lisp/dvc-log.el
+++ mod/lisp/dvc-log.el
@@ -106,7 +106,7 @@
(set-buffer-modified-p nil))
(rename-buffer buffer-name))
(dvc-log-edit-mode)
- (setq dvc-partner-buffer start-buffer)))
+ (set (make-local-variable 'dvc-partner-buffer) start-buffer)))
(defun dvc-log-edit-abort ()
"Abort the current log edit."