Emacs 中 Bazaar 提交问题

在 Emacs 中使用 vc 操作 Bazaar 时碰到了两个问题:

  • 在 vc-dir 中如果有多个修改的问题,然后标记其中的一些,提交后,所有的文件都被提交,而不是标记的那些。
  • 如果提交注解(commit comment)有多行,只有第一行当作真正的提交注解,其他的都丢弃了。并且所有文件都被提交。

这个问题很久以前就发现了,一直也没有仔细看过,所以在 Windows 上一直都没有在 Emacs 中使用 Bazaar,而是使用命令行,写提交注解尤其是多行注解的时候很不方便。已经给 Emacs 提交了 [bug 报告]。在 Linux 上没有问题。

今天仔细研究了一下,也顺便学习了一下 Elisp。整个版本控制包(vc)的概念比较简单,很多操作都是在一个函数中完成的——vc-next-action 中完成。

  1. vc.el:988:vc-next-action:1088
  2. ;; 调用 start-logentry 时定义了一个 lambda 函数
  3. vc.el:1330:vc-checkin:1344
  4. ;; 如果用户按下 C-c C-c 时
  5. vc-dispatcher.el:539:start-logentry:575
  6. ;; 这里的 log-operation 就是上面定义的 lambda 函数
  7. vc-dispatcher.el:579:finish-logentry:606
  8. ;; 获得一些提交信息
  9. vc.el:1330:vc-checkin:1360
  10. vc-bzr.el:403:vc-bzr-checkin:411
  11. vc-bzr.el:90:vc-bzr-command:98
  12. ;; 两个 apply 调用分别运行在后台和前台
  13. vc-dispatcher.el:271:vc-do-command

那问题是出在哪里呢?vc-do-command 中打开 vc-command-messages后,就有调试信息打出来,我们看一看 *Messages 中的消息:

  1. Running bzr commit -m add file3
  2.  file3.txt in foreground...
  3. Running bzr commit -m add file3
  4.  file3.txt...OK = 0

可以看到,1) 似乎提交注解“add file3” 没有引号引起来,2) 中间多了个回车,完整的命令应该是:bzr commit -m "add file3 file3.txt

如果把提交注解最后的回车去掉之后是可以成功的,但是对于多行注解来讲就不适用了。似乎还不好解决。看看 Emacs 的人怎么说。

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • You can use BBCode tags in the text.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo].
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.