emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: No commit in vc?


From: Dan Nicolaescu
Subject: Re: No commit in vc?
Date: Sat, 30 Jan 2010 11:49:11 -0800 (PST)

Eli Zaretskii <address@hidden> writes:

  > > From: Óscar Fuentes <address@hidden>
  > > Date: Fri, 29 Jan 2010 19:29:12 +0100
  > > 
  > > > +       (propertize "Pending merges, commit recommended before any 
other action"
  > > > +                   'help-echo "Explain here what is going on"
  > > > +                   'face 'font-lock-warning-face))))))
  > > 
  > > Saying that there are pending merges is enough. It is not VC-dir
  > > business to recommend what the user should or should not do, just
  > > provide the relevant information.
  > 
  > I disagree.  I think this recommendation is a good idea.  Maybe just
  > change the wording slightly:
  > 
  >   Pending merges, commit recommended before any further development
  > 
  > > And in this case the recommendation is misleading because, apart
  > > from commit, there are operations which are acceptable and useful
  > > when there is a pending merge: diff, revert, resolve, editing the
  > > changes, etc.
  > 
  > Well, the modified wording covers that, I think.

It's still too terse.  The goal is to explain what is going on to people
that are not used to bzr, and will get confused by getting an error on a
subsequent selective commit.
What's the reason not to have a very clear and unambiguous explanation?
If it avoids reading help/ searching for clues, user will only be happy.

Here's a new version of this, just replace this function in vc-bzr.el
Please feel free to improve the text.

(defun vc-bzr-dir-extra-headers (dir)
  (let*
      ((str (with-temp-buffer
              (vc-bzr-command "info" t 0 dir)
              (buffer-string)))
       (shelve (vc-bzr-shelve-list))
       (shelve-help-echo "Use M-x vc-bzr-shelve to create shelves")
       (root-dir (vc-bzr-root dir))
       (pending-merge
        (file-exists-p
         (expand-file-name ".bzr/checkout/merge-hashes" root-dir)))
       (light-checkout
        (when (string-match ".+light checkout root: \\(.+\\)$" str)
          (match-string 1 str)))
       (light-checkout-branch
        (when light-checkout
          (when (string-match ".+checkout of branch: \\(.+\\)$" str)
            (match-string 1 str)))))
    (concat
     (propertize "Parent branch      : " 'face 'font-lock-type-face)
     (propertize
      (if (string-match "parent branch: \\(.+\\)$" str)
          (match-string 1 str)
        "None")
       'face 'font-lock-variable-name-face)
     "\n"
      (when light-checkout
        (concat
         (propertize "Light checkout root: " 'face 'font-lock-type-face)
         (propertize light-checkout 'face 'font-lock-variable-name-face)
         "\n"))
      (when light-checkout-branch
        (concat
         (propertize "Checkout of branch : " 'face 'font-lock-type-face)
         (propertize light-checkout-branch 'face 'font-lock-variable-name-face)
         "\n"))
      (when pending-merge
        (concat
         (propertize "Warning            : " 'face 'font-lock-warning-face
                     'help-echo shelve-help-echo)
         (propertize "Pending merges, commit recommended before any other 
action"
                     'help-echo (format "A merge has been performed.\nA commit 
from the top-level directory (%s)\nis required before being able to check in 
anything else" root-dir)
                     'face 'font-lock-warning-face)
         "\n"))
      (if shelve
          (concat
           (propertize "Shelves            :\n" 'face 'font-lock-type-face
                       'help-echo shelve-help-echo)
           (mapconcat
            (lambda (x)
              (propertize x
                          'face 'font-lock-variable-name-face
                          'mouse-face 'highlight
                          'help-echo "mouse-3: Show shelve menu\nA: Apply and 
keep shelf\nP: Apply and remove shelf (pop)\nS: Snapshot to a shelf\nC-k: 
Delete shelf"
                          'keymap vc-bzr-shelve-map))
            shelve "\n"))
        (concat
         (propertize "Shelves            : " 'face 'font-lock-type-face
                     'help-echo shelve-help-echo)
         (propertize "No shelved changes"
                     'help-echo shelve-help-echo
                     'face 'font-lock-variable-name-face))))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]