Matthieu wrote:
> Stefan Reichör <[EMAIL PROTECTED]> writes:
>
> > However, I will add probably the 'add' and the 'commit' commands first.
>
> Be carefull not to add too many things before the things get
> well organized.
I think so, too.
I think we can learn more from vc.el.
(defun xhg-diff (dont-switch)
"Run hg diff.
If DONT-SWITCH, don't switch to the diff buffer"
(interactive "P")
(let ((buffer (tla--get-buffer-create 'file-diff))
(orig-buffer (current-buffer)))
(if tla-switch-to-buffer-first
(tla-switch-to-buffer buffer)
(set-buffer buffer))
(let ((inhibit-read-only t))
(erase-buffer))
(diff-mode)
(when dont-switch (pop-to-buffer orig-buffer))
(dvc--run-dvc-sync 'hg '("diff")
You are passing 'hg to dvc--run-dvc-sync.
However, if you implement `dvc-current-active-dvc' in dvc-core.el,
you don't have to do so; 'hg is automatically given by current directly.
As fas as I know, vc detects version control system used in the current
file automatically.
One more. vc provide generic front end for each commands; e.g. C-x v =.
In other hand, you provide xhg-diff for hg and xtla-diff for tla.
However, diff is so common in version control system, I think we should
provide common interface dvc-diff which calls xhg-diff, xtla-diff, etc.
Of course distributed version control systems are complicated, it is
difficult to cover all aspects of all distributed version control systems in
the common interface. However, at least add, commit and diff are common.
Layers I image:
+--------------------------------+------------------------+
| dvc-ui | |
+--------------------------------+ |
| per version contsol system ui |
+------------------+--------------------------------------+
| dvc-core | per version contsol system core |
+------------------+--------------------------------------+
If an user wants one can do nasty like:-P
+-------+--------------------------------+------------------------+
| dvc-ui | |
+-------+--------------------------------+ |
| vc | per version contsol system ui |
|pcl-cvs+------------------+--------------------------------------+
| psvn | dvc-core | per version contsol system core |
+-------+------------------+--------------------------------------+