unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* vc-svn and "resolved"
@ 2007-09-08 19:28 Tom Tromey
  2007-09-19  3:33 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2007-09-08 19:28 UTC (permalink / raw)
  To: emacs-pretest-bug

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:


After an "svn update", sometimes a file will have a conflict.  With
svn, unlike cvs, you must run "svn resolved" on a file after resolving
conflicts.

I think vc-svn should do this for me.  Ideally this would happen
automatically when I edit out the conflict markers and save the file.
However, even having 'C-x v v' do this at the appropriate point would
be an improvement.  Current I have to switch to the shell and do this
by hand.



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.0.990/etc/DEBUG for instructions.


In GNU Emacs 22.0.990.1 (i386-koji-linux-gnu, GTK+ Version 2.10.11)
 of 2007-05-23 on xenbuilder3.fedora.phx.redhat.com
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--build=i386-koji-linux-gnu' '--host=i386-koji-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-pop' '--with-sound' '--with-gtk' 'build_alias=i386-koji-linux-gnu' 'host_alias=i386-koji-linux-gnu' 'target_alias=i386-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -DSYSTEM_PURESIZE_EXTRA=16777216 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables''

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: CVS

Minor modes in effect:
  compilation-in-progress: (gid grep grep compilation compilation compilation gid gid gid gid gid gid gid gid compilation compilation gid gid compilation gid gid gid gid gid compilation compilation compilation gid compilation compilation gid compilation grep grep grep grep gid grep compilation gid gid compilation compilation compilation compilation compilation compilation gid gid grep gid compilation gid gid compilation gid gid compilation gid gid gid gid compilation gid gid compilation compilation)
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-spelling-mode: t
  erc-truncate-mode: t
  shell-dirtrack-mode: t
  erc-status-mode: t
  erc-services-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-readonly-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<mouse-4> <down-mouse-4> <mouse-4> <down-mouse-4> <mouse-4> 
<down-mouse-4> <mouse-4> <down-mouse-4> <mouse-4> <down-mouse-4> 
<mouse-4> <down-mouse-4> <mouse-4> <down-mouse-5> <mouse-5> 
<switch-frame> C-s C-g C-z o M-v C-z o C-g C-z o C-r 
s t a t e C-r C-r C-r C-r C-r C-z o C-s s t a t e C-s 
C-s C-s C-s C-s C-s C-s C-v C-s C-s C-s C-s C-v C-s 
G C-s C-u C-n C-l C-a C-s c o n f C-s l i c t C-s C-s 
C-s C-a C-s r e s o l C-s C-a M-x l g r e p <return> 
r e s o o l v e d C-u C-b <backspace> <return> <return> 
<return> C-z o C-x b p s <tab> M-x f i n d - f u n 
<tab> <return> s v - <backspace> n - u p <tab> <return> 
<M-backspace> e x <tab> <return> C-s s v n - u p d 
a t e C-s C-s C-s C-s C-s g g g g C-g C-g C-g C-g C-s 
a u t o l o a d C-s C-s C-s C-s C-s C-s C-g C-g C-g 
C-g C-z o C-x o C-x 1 C-z o C-z o C-c b M-x r e p o 
r <tab> e m <tab> <tab> b <tab> C-g M-x c v s - u d 
<tab> <backspace> <tab> <return> <M-backspace> <return> 
C-z o C-u C-u C-n C-l C-s r e s o l v e d C-s C-s C-s 
C-s C-s C-r C-r C-s C-s C-s C-s C-s C-s C-s C-s C-s 
C-s C-a C-r C-r C-r C-s C-s C-s C-s C-s C-a C-z o C-v 
C-v C-v C-v C-v C-v C-l C-s v c C-n C-n C-n C-l C-v 
C-v C-l C-x C-g M-x r e p o r t - e <tab> b <tab> 
<return>

Recent messages:
Making completion list...
Quit
Loading pcvs...done
(No files need saving)
Running cvs update ...
Mark saved where search started [2 times]
Loading smerge-mode...done
CVS process has completed in *cvs*
Mark saved where search started
Loading emacsbug...done

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: vc-svn and "resolved"
  2007-09-08 19:28 vc-svn and "resolved" Tom Tromey
@ 2007-09-19  3:33 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-09-19  3:33 UTC (permalink / raw)
  To: Tom Tromey; +Cc: emacs-pretest-bug

> After an "svn update", sometimes a file will have a conflict.  With
> svn, unlike cvs, you must run "svn resolved" on a file after resolving
> conflicts.

> I think vc-svn should do this for me.  Ideally this would happen
> automatically when I edit out the conflict markers and save the file.

The patch below might be a good starting point.  Could you try it out?


        Stefan


--- vc-svn.el	28 jui 2007 16:22:17 -0400	1.34.2.1
+++ vc-svn.el	18 sep 2007 23:26:14 -0400	
@@ -493,6 +493,33 @@
       ;; behavior for different modules on the same server.
       (match-string 1))))
 
+(defun vc-svn-resolve-when-done ()
+  "Call \"svn resolved\" if the conflict markers have been removed."
+  (save-excursion
+    (goto-char (point-min))
+    (if (not (re-search-forward "^<<<<<<< " nil t))
+        (vc-svn-command nil 0 buffer-file-name "resolved"))))
+
+;; Inspired by vc-arch-find-file-hook.
+(defun vc-svn-find-file-hook ()
+  (when (eq ?C (vc-file-getprop buffer-file-name 'vc-svn-status))
+    ;; If the file is marked as "conflicted", then we should try and call
+    ;; "svn resolved" when applicable.
+    (if (save-excursion
+          (goto-char (point-min))
+          (re-search-forward "^<<<<<<< " nil t))
+        ;; There are conflict markers.
+        (progn
+          (smerge-mode 1)
+          (add-hook 'after-save-hook 'vc-svn-resolve-when-done nil t))
+      ;; There are no conflict markers.  This is problematic: maybe it means
+      ;; the conflict has been resolved and we should immediately call "svn
+      ;; resolved", or it means that the file's type does not allow Svn to
+      ;; use conflict markers in which case we don't really know what to do.
+      ;; So let's just punt for now.
+      nil)
+    (message "There are unresolved conflicts in this file")))
+
 (defun vc-svn-parse-status (&optional filename)
   "Parse output of \"svn status\" command in the current buffer.
 Set file properties accordingly.  Unless FILENAME is non-nil, parse only
@@ -515,6 +542,8 @@
 	;; Use the last-modified revision, so that searching in vc-print-log
 	;; output works.
 	(vc-file-setprop file 'vc-workfile-version (match-string 3))
+        ;; Remember Svn's own status.
+        (vc-file-setprop file 'vc-svn-status status)
 	(vc-file-setprop
 	 file 'vc-state
 	 (cond

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-19  3:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-08 19:28 vc-svn and "resolved" Tom Tromey
2007-09-19  3:33 ` Stefan Monnier

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).