* bug#8389: feature proposal: chng login vc-rcs-checkin
@ 2011-03-31 14:15 Uwe Brauer
2022-05-10 4:07 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2011-03-31 14:15 UTC (permalink / raw)
To: 8389
Hello
When collaborating with someone I find it useful to use vc
(rcs) and change the login accordingly when I checkin a new
version. The following code does it, but maybe there are
more sophisticated versions possible.
Uwe Brauer
(defvar vc-rcs-ask-for-login nil
"*Variable which allows to change the login Id by a y-or-n question.")
(defun vc-rcs-checkin (file rev comment)
"RCS-specific version of `vc-backend-checkin'. If the variable
vc-rcs-ask-for-login is set to t, function asks for user login.
Useful for collaboration to distinguish different checkins."
;;(interactive "p")
(let ((switches (vc-switches 'RCS 'checkin)))
(let ((old-version (vc-workfile-version file)) new-version
(default-branch (vc-file-getprop file 'vc-rcs-default-branch)))
;; Force branch creation if an appropriate
;; default branch has been set.
(and (not rev)
default-branch
(string-match (concat "^" (regexp-quote old-version) "\\.")
default-branch)
(setq rev default-branch)
(setq switches (cons "-f" switches)))
(if (and (not rev) old-version)
(setq rev (vc-branch-part old-version)))
(apply 'vc-do-command nil 0 "ci" (vc-name file)
;; if available, use the secure check-in option
(and (vc-rcs-release-p "5.6.4") "-j")
(concat (if vc-keep-workfiles "-u" "-r") rev)
(if vc-rcs-ask-for-login
(if (y-or-n-p (format "Do you want to change the login "))
(concat "-w" (read-string "Enter New login: "))
(concat "-m" comment)))
(concat "-m" comment)
switches)
(vc-file-setprop file 'vc-workfile-version nil)
;; determine the new workfile version
(set-buffer "*vc*")
(goto-char (point-min))
(when (or (re-search-forward
"new revision: \\([0-9.]+\\);" nil t)
(re-search-forward
"reverting to previous revision \\([0-9.]+\\)" nil t))
(setq new-version (match-string 1))
(vc-file-setprop file 'vc-workfile-version new-version))
;; if we got to a different branch, adjust the default
;; branch accordingly
(cond
((and old-version new-version
(not (string= (vc-branch-part old-version)
(vc-branch-part new-version))))
(vc-rcs-set-default-branch file
(if (vc-trunk-p new-version) nil
(vc-branch-part new-version)))
;; If this is an old RCS release, we might have
;; to remove a remaining lock.
(if (not (vc-rcs-release-p "5.6.2"))
;; exit status of 1 is also accepted.
;; It means that the lock was removed before.
(vc-do-command nil 1 "rcs" (vc-name file)
(concat "-u" old-version))))))))
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/22.2/etc/DEBUG for instructions.
In GNU Emacs 22.2.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2010-03-26 on palmer, modified by Ubuntu
Windowing system distributor `The X.Org Foundation', version 11.0.10600000
configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs22:/etc/emacs:/usr/local/share/emacs/22.2/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/22.2/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/22.2/leim' '--with-x=yes' '--with-x-toolkit=athena' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8
default-enable-multibyte-characters: t
Major mode: Fundamental
Minor modes in effect:
global-pabbrev-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
unify-8859-on-encoding-mode: t
utf-translate-cjk-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
abbrev-mode: t
Recent input:
y C-x C-g C-g M-x e m a s c SPC r <backspace> <backspace>
<backspace> c d SPC <backspace> <backspace> s c <backspace>
<backspace> c s SPC r e p o r <tab> <M-backspace> b
<help-echo> <tab> <M-backspace> <M-backspace> b u g
SPC C-h <help-echo> a b <help-echo> u g <return> C-x
o C-s e m a c s C-s C-x o M-x r e p o r t SPC e m <tab>
<return>
Recent messages:
To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file. Start Emacs with
the `--debug-init' option to view a complete error backtrace.
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit [2 times]
Loading apropos...done
Type C-x 1 to remove help window.
Mark saved where search started
Loading emacsbug...done
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#8389: feature proposal: chng login vc-rcs-checkin
2011-03-31 14:15 bug#8389: feature proposal: chng login vc-rcs-checkin Uwe Brauer
@ 2022-05-10 4:07 ` Lars Ingebrigtsen
2022-05-11 12:34 ` Uwe Brauer
0 siblings, 1 reply; 3+ messages in thread
From: Lars Ingebrigtsen @ 2022-05-10 4:07 UTC (permalink / raw)
To: Uwe Brauer; +Cc: 8389
Uwe Brauer <oub@mat.ucm.es> writes:
> When collaborating with someone I find it useful to use vc
> (rcs) and change the login accordingly when I checkin a new
> version. The following code does it, but maybe there are
> more sophisticated versions possible.
[...]
> (if vc-rcs-ask-for-login
> (if (y-or-n-p (format "Do you want to change the login "))
> (concat "-w" (read-string "Enter New login: "))
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
This seems like quite niche functionality, so I don't think it would be
appropriate for Emacs, so keeping it as a local customisation is
probably best.
Furthermore, rcs doesn't seem to have a -w switch (at least on Debian)
these days:
$ rcs -w
rcs: unknown option: -w
So I'm closing this bug report as a "wontfix".
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#8389: feature proposal: chng login vc-rcs-checkin
2022-05-10 4:07 ` Lars Ingebrigtsen
@ 2022-05-11 12:34 ` Uwe Brauer
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2022-05-11 12:34 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: Uwe Brauer, 8389
[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]
>>> "LI" == Lars Ingebrigtsen <larsi@gnus.org> writes:
> Uwe Brauer <oub@mat.ucm.es> writes:
>> When collaborating with someone I find it useful to use vc
>> (rcs) and change the login accordingly when I checkin a new
>> version. The following code does it, but maybe there are
>> more sophisticated versions possible.
> [...]
>> (if vc-rcs-ask-for-login
>> (if (y-or-n-p (format "Do you want to change the login "))
>> (concat "-w" (read-string "Enter New login: "))
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
> This seems like quite niche functionality, so I don't think it would be
> appropriate for Emacs, so keeping it as a local customisation is
> probably best.
> Furthermore, rcs doesn't seem to have a -w switch (at least on Debian)
> these days:
> $ rcs -w
> rcs: unknown option: -w
Right, I have written this a long time ago, and switched to mercurial and don't use RCS not anymore.
--
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military.
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-11 12:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-31 14:15 bug#8389: feature proposal: chng login vc-rcs-checkin Uwe Brauer
2022-05-10 4:07 ` Lars Ingebrigtsen
2022-05-11 12:34 ` Uwe Brauer
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).