[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnu-arch-users] Graphical merges
From: |
Matthieu Moy |
Subject: |
Re: [Gnu-arch-users] Graphical merges |
Date: |
Wed, 21 Apr 2004 01:27:02 +0200 |
User-agent: |
Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (gnu/linux) |
Matthieu Moy <address@hidden> writes:
> Hi all,
>
> I'm trying to set up a prototype of graphical conflicts resolution
> tool using ediff mode in Emacs.
Pfiouu, I'm impressed how easy it was :-)
It'll be integrated in xtla.el, but as it is rather independant from
the rest of the package, it may interest some people if I post it
here :
(defvar xtla-mine-string "TREE")
(defvar xtla-his-string "MERGE-SOURCE")
(defun xtla-view-conflicts (file)
"Graphical view of conflicts after tla star-merge --three-way"
(interactive "f")
(let ((mine-buffer (get-buffer-create "*xtla-mine*"))
(his-buffer (get-buffer-create "*xtla-his*")))
(with-current-buffer mine-buffer
(erase-buffer)
(insert-file-contents file)
(goto-char (point-min))
(while (re-search-forward (concat "^<<<<<<< "
(regexp-quote xtla-mine-string) "$")
nil t)
(beginning-of-line)
(delete-region (point) (1+ (line-end-position)))
(re-search-forward "^=======$")
(beginning-of-line)
(delete-region (point) (progn
(re-search-forward
(concat "^>>>>>>> "
(regexp-quote xtla-his-string)
"\n"))))
))
(with-current-buffer his-buffer
(erase-buffer)
(insert-file-contents file)
(goto-char (point-min))
(while (re-search-forward (concat "^<<<<<<< "
(regexp-quote xtla-mine-string) "$")
nil t)
(beginning-of-line)
(delete-region (point) (progn
(re-search-forward "^=======\n")))
(re-search-forward
(concat "^>>>>>>> "
(regexp-quote xtla-his-string) "$"))
(beginning-of-line)
(delete-region (point) (1+ (line-end-position)))
)
)
(ediff-buffers mine-buffer his-buffer)
))
--
Matthieu
- [Gnu-arch-users] Graphical merges, Matthieu Moy, 2004/04/20
- Re: [Gnu-arch-users] Graphical merges,
Matthieu Moy <=
- [Gnu-arch-users] Re: Graphical merges, Stefan Monnier, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Aaron Bentley, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Stefan Monnier, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Aaron Bentley, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Stefan Monnier, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Aaron Bentley, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Stefan Monnier, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Aaron Bentley, 2004/04/21
- Re: [Gnu-arch-users] Re: Graphical merges, Matthieu Moy, 2004/04/21
- [Gnu-arch-users] Librification of libarch, Matthew Dempsky, 2004/04/21