Subject: Re: bug#4179: vc-merge with svn: syntax error in revision arg.

From: Dan Nicolaescu <[email-masked]>
Date: Wed, 26 Aug 2009 11:04:57 -0700 (PDT)

Stefan Monnier <[email-masked]> writes:

  > > vc-default-{previous,next}-revision use them, but they can go into
  > > vc-rcs (or vc-cvs) and make one use the other (there's a precedent,
  > > vc-cvs-comment-history uses an RCS backend function...).
  > 
  > > Do you see an elegant way of dealing with this?
  > 
  > Move them to vc-rcs.

I did that.

  > > Stefan, how would you go about making these functions backend specific:
  > 
  > > (defun vc-trunk-p (rev)
  > > (defun vc-branch-p (rev)
  > > (defun vc-branch-part (rev)
  > > (defun vc-minor-part (rev)
  > 
  > Not sure: for some backends (svn, bzr, darcs at least), they simply
  > don't make any sense.
  > 
  > > It seems to me that only `vc-branch-p' needs to be backend specific, the
  > > rest are only used by RCS and CVS.
  > 
  > That sounds right.

Also moved + renamed vc-trunk-p and vc-minor-part to vc-rcs.el, they are
only used in that file now.

All the above turned out to be a good cleanup, but unfortunately
not necessarily related to the problem in this bug report.

We have this code in `vc-merge'

    (if (string= first-revision "")
        (setq status (vc-call-backend backend 'merge-news file))
      (if (not (vc-find-backend-function backend 'merge))
        (error "Sorry, merging is not implemented for %s" backend)
        (if (not (vc-branch-p first-revision))
            (setq second-revision
                    (read-string "Second revision: "
                         (concat (vc-branch-part first-revision) ".")))
           ;; We want to merge an entire branch.  Set revisions
           ;; accordingly, so that vc-BACKEND-merge understands us.
           (setq second-revision first-revision)
           ;; first-revision must be the starting point of the branch
          (setq first-revision (vc-branch-part first-revision)))

`vc-branch-p' can be made VC backend specific.
But what should we do with `vc-branch-part'?
What should be the new structure of this code?