From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: SCCS version control cannot cope when latest delta is of type 'removed'
Date: Fri, 27 Oct 2006 16:02:04 -0600 [thread overview]
Message-ID: <ehtvm9$li2$1@sea.gmane.org> (raw)
In-Reply-To: <200610270032.k9R0W8Xc018443@windhorse.sfbay.sun.com>
Chet Wood wrote:
> In the shell using regular sccs commands, or in emacs using C-x C-q,
> check out an sccs-versioned file that has had its latest delta
> removed. Then, in another emacs session, VC commands, such as
> vc-directory or vc-next-action, fail.
>
> When vc-sccs-workfile-version(file) searches for the latest version
> number in the sccs file, it searches for "^Ad D". However, there can
> be another type of delta, namely "^Ad R". In this case, the delta does
> not really exist-- it was removed, leaving this delta entry as a
> "bread crumb" in the sccs file. The search is limited to the first
> delta entry, so it fails and the function returns nil, and as a
> result, a blank version number is passed to vcdiff and it fails.
>
> I tried changing the search to accept [D|R] but it then returns the
> removed delta number, which does not really exist, and other errors
> ensue.
>
> (This scenario happens sometimes when the Sun CodeManager configuration
> management tool is used. It apparently inserts its own bookkeeping
> comments by adding and removing a delta. It seems to happen when a new
> file is added to the workspace, then the workspace is putback to
> another workspace.)
>
> Suggested Fix:
> The search should skip the top delta in the sccs file if it is of type
> "removed", and return the version number of the next delta.
> But IMHO it would be more robust to run the command "sccs
> prt filename" to obtain the version, rather than relying on the
> internal file format, assuming this works on all platforms.
Your second suggestion may be more robust, but since vc-parse-buffer
returns a useful value to vc-sccs-workfile-version, I think we can take
advantage of that to implement a simple fix:
2006-10-27 Kevin Rodgers <ihs_4664@yahoo.com>
* vc-sccs.el (vc-sccs-workfile-version): If the top delta entry
was removed, return the next entry.
*** vc-sccs.el~ 2006-04-22 06:42:26.750000000 -0600
--- vc-sccs.el 2006-10-27 15:53:08.760978700 -0600
***************
*** 144,150 ****
;; rather than just the first entry, because the
;; first entry might be a deleted ("R") version.
(vc-insert-file (vc-name file) "^\001e\n\001[^s]")
! (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1)))
(defun vc-sccs-checkout-model (file)
"SCCS-specific version of `vc-checkout-model'."
--- 144,155 ----
;; rather than just the first entry, because the
;; first entry might be a deleted ("R") version.
(vc-insert-file (vc-name file) "^\001e\n\001[^s]")
! (let ((top-delta (save-excursion ; vc-parse-buffer changes point
! (vc-parse-buffer "^\001d \\([DR]\\) \\([^ ]+\\)" 2))))
! (if (and top-delta
! (equal (match-string 1) "R")) ; the delta entry was Removed
! (vc-parse-buffer "^\001d D \\([^ ]+\\)" 1)
! top-delta))))
(defun vc-sccs-checkout-model (file)
"SCCS-specific version of `vc-checkout-model'."
> A workaround is to make a change to the checked-out file (like adding
> a blank line to the end or any other change) and check it back
> in outside of emacs, creating a real latest delta. Then it can be
> checked out again, and should work fine.
--
Kevin
next prev parent reply other threads:[~2006-10-27 22:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-27 0:32 SCCS version control cannot cope when latest delta is of type 'removed' Chet Wood
2006-10-27 22:02 ` Kevin Rodgers [this message]
2006-10-31 19:36 ` Kevin Rodgers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ehtvm9$li2$1@sea.gmane.org' \
--to=ihs_4664@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).