commit ba7f8868fc20ca1582a5ab1927be5f6009a61c40 Author: Romain Failliot Date: Sat Nov 21 12:57:32 2015 -0500 First commit Original Diffuse source code from sourceforge. Version 0.4.8 + some further changes. diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..62540a3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,17 @@ +Programming +----------- +Derrick Moser + +Translators +----------- +Akom Chotiphantawanon (Thai) +Chi Ming (Traditional Chinese) +Cristian Marchi (Italian) +Derrick Moser (Japanese) +Henri Menke (German, Spanish) +Jindřich Šesták (Czech) +Kang Bundo (Korean) +Liu Hao (Simplified Chinese) +Miś Uszatek (Polish) +Oleg Pakhtusov (Russian) +Wei-Lun Chao (Traditional Chinese) diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..a43ea21 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..3c27c15 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,188 @@ +- added Akom Chotiphantawanon's Thai translation +- updated Python highlighting for Python 3 grammar +- added a preference and command line option to specify the version control system search order + +Diffuse 0.4.8 - 2014-07-18 +- updated use of gtk.SpinButton and gtk.Entry to avoid quirks seen on some platforms +- fixed a bug that prevented Diffuse from reviewing large git merge conflicts +- updated C/C++ syntax highlighting to recognise C11/C++11 keywords +- fixed a bug that prevented drag-and-drop of file paths with non-ASCII characters +- improved image quality of icons +- added Chi Ming and Wei-Lun Chao's Traditional Chinese translation + +Diffuse 0.4.7 - 2013-05-13 +- added Jindřich Šesták's Czech translation +- improved character editing to allow easy indenting and moving the cursor by whole words +- added Miś Uszatek's Polish translation +- improved auto-detection of utf_16 and utf_32 +- added "New N-Way File Merge..." menu item +- added syntax highlighting for Erlang and OpenCL files + +Diffuse 0.4.6 - 2011-11-02 +- added support for Subversion 1.7 +- added "Open Commit..." menu item +- "-c" option now works for all supported version control systems +- fixed a bug that caused the wrong revision to be shown when working on a branch in Mercurial +- Git support distinguishes between staged and unstaged files +- added syntax highlighting for R files + +Diffuse 0.4.5 - 2011-07-13 +- fixed a bug in CVS and Subversion support that prevented Diffuse from displaying some removed files +- added syntax highlighting for JSON files +- added menu items and keyboard shortcuts for "First Tab" and "Last Tab" +- added "--line" command line option +- fixed a bug that caused deleted files to be ignored when using the '-m' option +- fixed a bug that incorrectly encoded pasted text if utf_8 was not specified in the Region Settings preferences +- state information is now stored in ~/.local/share/diffuse +- Diffuse now uses a patience diff-based algorithm to align lines +- added command line option to specify a label to display instead of the file name +- added preference to display the right margin +- added Cristian Marchi's Italian translation +- fixed a bug that could cause "Save As..." to fail with some user specified encodings + +Diffuse 0.4.4 - 2010-10-21 +- Git support now recognises conflicts when re-applying the stash +- double clicking on text can now select full words with non-English characters +- search dialog is now automatically populated with the currently selected text +- fixed a bug that prevented opening files with non-ASCII characters in their path +- added Oleg Pakhtusov's Russian translation +- added Kang Bundo's Korean translation +- pane headers tooltips +- Shift-ScrollWheel can now be used to scroll horizontally + +Diffuse 0.4.3 - 2010-04-15 +- fixed a bug that prevented the "-m" option from opening a 3-way merge for Subversion and Bazaar conflicts + +Diffuse 0.4.2 - 2010-04-13 +- support for detached Git repositories +- better removal of unnecessary spacer lines +- added support for horizontal mouse scrolling +- renamed some resources to more user friendly names +- RCS support +- added Henri Menke's Spanish translation +- "#!" interpreter lines are now used to select proper highlighting rules +- syntax highlighting is now indicated by radio menu items + +Diffuse 0.4.1 - 2009-10-12 +- added Japanese translation +- added Liu Hao's simplified Chinese translation +- added a 'Dismiss All Edits' menu item +- personal configuration files are now stored in ~/.config/diffuse/ (the README file describes how to migrate old settings) +- localised manuals are now supported on Windows +- new command line option for specifying blank file comparison panes +- new preference to enable/disable line numbers +- Diffuse now quits if no viewers were created with the -m option +- MMB on a notebook tab now closes the tab +- RMB on a notebook tab creates a popup menu to set the current page +- added "Undo Close Tab" menu item +- replaced "Closing last tab quits Diffuse" preference with a "Warn me when closing a tab will quit Diffuse" preference +- added new menu items and buttons for copying lines between panes +- changed the default hotkeys for merging to reflect the direction text "moves" + +Diffuse 0.4.0 - 2009-08-17 +- added format menu with new items for changing case, sorting, and manipulating white space +- replaced 'Hide end of line characters' preference with 'Show white space characters' +- errors are now reported in a dialogue instead of printing to stderr +- optimised redraws when only the cursor position has changed +- input methods that use pre-editing can now be used when editing text +- dead keys can now be used when editing text +- updated Monotone support to use 'mtn automate inventory' +- Git support now handles files flagged as 'unmerged' +- graceful handling of and non-zero exit codes from 'git status' +- added version control section to the manual +- minor bug fixes + +Diffuse 0.3.4 - 2009-07-03 +- syntax highlighting for .plist, GLSL, SConscript, and SConstruct files +- status bar now explains how to navigate between modes +- added labels to indicate syntax highlighting rules, encoding, and format +- Subversion 1.6 support +- added Henri Menke's German translation +- added '--examplesdir=' and '--mandir=' options to install.py +- renamed the '--python-interpreter=' installer option to '--pythonbin=' +- minor bug fixes + +Diffuse 0.3.3 - 2009-04-13 +- fixed a bug handling the backspace key with the cursor in the first column + +Diffuse 0.3.2 - 2009-04-13 +- POSIX installer with '--destdir=' and '--files-only' options for packagers +- vi-like keybindings for line mode +- '-m' option to open modified files in separate tabs +- 'Merge From Left Then Right' and 'Merge From Right Then Left' menu items +- drag-n-drop support +- preferences for behaviour of tabs +- files with edits now tagged with '*' +- auto indent +- 'Open File In New Tab...' and 'Open Modified Files...' menu items +- 'Save All' menu item +- mac-style line ending support +- new end of line display behaviour +- improved organisation of menu items +- button bar no longer grabs keyboard focus +- removed dependence on urllib module +- errors are now reported on stderr +- removed TODO list +- minor bug fixes + +Diffuse 0.3.1 - 2009-03-05 +- fixed a typo that broke the 'Find...' dialogue + +Diffuse 0.3.0 - 2009-03-03 +- new Windows installer +- notification on focus change when files change on disk +- menu items for adjusting indentation +- syntax highlighting for Objective-C++ +- '-c' option now works with CVS-style revision numbers +- window title now describes current tab +- search settings now persist across sessions +- minor bug fixes + +Diffuse 0.2.15 - 2008-12-03 +- smoother scrolling +- panes and tabs can now be manually re-organised +- preferences for tab key behaviour +- 'go to line' menu item +- '-c' option for viewing the changes of a particular commit +- home/end keys can now be used in line mode +- confirmation requested before overriding changed files +- position of window now saved +- syntax files for more file types +- reading /etc/diffuserc now optional when using a personal configuration file +- minor bug fixes + +Diffuse 0.2.14 - 2008-10-20 +- svk support +- syntax files for more file types +- DOS / Unix line endings now respected in edit operations +- improved difference map +- more robust launching of help browsers +- man page +- command line display options +- moved some resources to the preferences dialogue +- file revisions can now be specified in the open file dialogue +- minor bug fixes + +Diffuse 0.2.13 - 2008-05-16 +- bazaar, darcs, and monotone support +- configurable key bindings +- persistent preference settings +- optimisations +- minor bug fixes + +Diffuse 0.2.12 - 2008-05-06 +- alternate codecs for reading and writing files +- more search options +- editor support for primary selection +- minor bug fixes + +Diffuse 0.2.11 - 2008-04-27 +- cvs, subversion, git, mercurial support +- python re-write +- syntax highlighting +- search and replace +- customisable through configuration files +- tabbed viewer panes + +Diffuse 0.1.14 - 2006-01-28 +- initial public release diff --git a/ChangeLog_ru b/ChangeLog_ru new file mode 100644 index 0000000..e82b59c --- /dev/null +++ b/ChangeLog_ru @@ -0,0 +1,7 @@ +Diffuse 0.4.6 - 2011-11-02 +- добавлена поддержка Subversion 1.7 +- добавлен пункт меню "Открыть Зафиксированные..." +- "-c" опция теперь работает для всех поддерживаемых систем контроля версий +- исправлена ошибка, из-за которой показывалась неправильная версия при работе в ветке Mercurial +- Git поддержка различает каскадные и некаскадные файлы +- добавлена подсветка синтаксиса для R файлов diff --git a/README b/README new file mode 100644 index 0000000..bef939e --- /dev/null +++ b/README @@ -0,0 +1,89 @@ +Diffuse +Version 0.4.8 + +Copyright (C) 2006-2014 Derrick Moser + +---- + +Diffuse is a graphical tool for merging and comparing text files. Diffuse is +able to compare an arbitrary number of files side-by-side and gives users the +ability to manually adjust line matching and directly edit files. Diffuse can +also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, +Monotone, RCS, Subversion, and SVK repositories for comparison and merging. + +Some key features of Diffuse: +- ability to compare and merge an arbitrary number of files side-by-side (n-way merges) +- line matching can be manually corrected by the user +- ability to directly edit files +- syntax highlighting +- Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK support +- Unicode support +- unlimited undo +- easy keyboard navigation + +---- + +Requirements: + +- Python >= 2.4 +- PyGTK >= 2.10 + +---- + +Diffuse is implemented entirely in Python and should run on any platform with +Python and PyGTK. If you need to manually install PyGTK, please be aware its +dependencies should be installed prior to installing PyGTK. + +Diffuse can be run directly from an untared source distribution on any POSIX +system or installed with the instructions described in the next section. + +The location of the personal preferences, state, and initialisation files have +changed in the 0.4.1 release. Old settings may be migrated using the following +commands: + + $ mkdir -p ~/.config/diffuse + $ mv ~/.diffuse/config ~/.config/diffuse/state + $ mv ~/.diffuse/* ~/.config/diffuse + $ rmdir ~/.diffuse + +The rules for parsing files in ~/.diffuse changed in the 0.3.0 release. +Non-fatal errors may be reported when parsing old files. These errors can be +fixed by removing the offending lines (or the entire file) from +~/.config/diffuse/diffuserc. + +---- + +Installing on POSIX systems: + +Run the 'install.py' script to install Diffuse. The script accepts several +options for customising the installation behaviour. Use the '--help' option +to obtain a full listing. + +Diffuse can be removed by running the 'install.py' script with the '--remove' +option. + +Specify the '--destdir=' and '--files-only' options for the 'install.py' +script when using it to build a platform specific package of Diffuse. + +---- + +Installing on Windows: + +The 'windows-installer' directory contains scripts for building an installable +package for Windows that includes all dependencies. + +Diffuse can be packaged as a portable application by copying the installation +directory to a pen drive and creating a front end that sets the XDG_CONFIG_HOME +and XDG_DATA_DIR environment variables prior to launching Diffuse. The +XDG_CONFIG_HOME and XDG_DATA_DIR environment variables indicate where Diffuse +should store persistent settings (eg. the path to a writable directory on the +pen drive). + +---- + +Help Documentation: + +Diffuse's help documentation is written in the DocBook format and can be easily +converted into other formats using XSLT stylesheets. If the local help +documentation or its browser are unavailable, Diffuse will attempt to display +the on-line help documentation using a web browser. diff --git a/README_ru b/README_ru new file mode 100644 index 0000000..d5a1fb2 --- /dev/null +++ b/README_ru @@ -0,0 +1,93 @@ +Diffuse +Версия 0.4.8 + +Copyright (C) 2006-2014 Derrick Moser +Перевод:О.Ю.Пахтусов (Oleg Pakhtusov) + +---- + +Программа Diffuse является графическим инструментом для слияния и сравнения +текстовых файлов. Она может сравнить произвольное число файлов в представлении +бок о бок, предоставляет пользователям возможность вручную корректировать +соответствие строк и редактировать файлы напрямую. Diffuse может также +извлекать ревизии файлов из Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, +Subversion и SVK репозиториев для их сравнения и слияния. + +Некоторые основные свойства Diffuse: +- возможность сравнивать и объединять произвольное число файлов бок о бок (n-оконные слияния) +- соответствие строк может быть скорректирована пользователем вручную +- возможность напрямую редактировать файлы +- подсвечивание синтаксиса +- Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion и SVK поддержка +- поддержка Unicode +- неограниченное число отмен +- легкая навигация с помощью клавиатуры + +---- + +Требования: + +- Python >= 2.4 +- PyGTK >= 2.10 + +---- + +Diffuse реализована полностью на Python и должен работать на любой платформе с +Python и PyGTK. Если Вам нужно вручную установить PyGTK, пожалуйста знайте +зависимости (подчиненные) должны быть инсталлированы до установки PyGTK. + +Diffuse может быть выполнена непосредственно из не .tar исходного дистрибутива +на любой POSIX системе или установлена с инструкциями, описанными в следующем +разделе. + +Расположение персональных предпочтений, состояния, и файлов инициализации +изменены в 0.4.1 выпуске. Старые настройки могут быть перемещены использованием +следующих команд: + + $ mkdir -p ~/.config/diffuse + $ mv ~/.diffuse/config ~/.config/diffuse/state + $ mv ~/.diffuse/* ~/.config/diffuse + $ rmdir ~/.diffuse + +Правила для парсинга файлов в ~/.diffuse изменены в 0.3.0 выпуске. Могут +сообщаться нефатальные ошибки на парсинге старых файлов. Эти ошибки могут быть +устранены удалением проблемных строк (или всего файла) из +~/.config/diffuse/diffuserc. + +---- + +Установка на POSIX системах: + +Выполните 'install.py' скрипт для установки Diffuse. Скрипт принимает несколько +опций для настройки поведения установки. Используйте опцию '--help', чтобы +получить полное перечисление этих опциий. + +Diffuse может быть деинсталлирован выполнением 'install.py' скрипта с опцией +'--remove'. + +Определите опции '--destdir=' и '--files-only' для 'install.py' скрипта при +использовании для создания платформо-определенного пакета Diffuse. + +---- + +Установка на Windows: + +Каталог 'windows-installer' содержит скрипты для сборки устанавливаемого +Windows пакета, который включает все зависимости. + +Программа Diffuse может быть собрана как портативное приложение путем +копирования каталога установки на флэшку и создания внешнего интерфейса, +который устанавливает переменные окружения (среды) XDG_CONFIG_HOME и +XDG_DATA_DIR перед запуском Diffuse. Переменные окружения (среды) +XDG_CONFIG_HOME и XDG_DATA_DIR указывают где программа Diffuse должна хранить +свои постоянные настройки (напр. путь к перезаписываемому каталогу на данной +флэшке). + +---- + +Справочная Документация: + +Справочная документация Diffuse написана в формате DocBook и может быть легко +преобразована в другие форматы, используя XSLT таблицы стилей. Если локальная +справочная документация или ее браузер недоступны, Diffuse попытается +отобразить онлайновую справочную документацию, используя веб-браузер. diff --git a/install.py b/install.py new file mode 100755 index 0000000..f039205 --- /dev/null +++ b/install.py @@ -0,0 +1,280 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2009-2010 Derrick Moser +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the licence, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program. You may also obtain a copy of the GNU General Public License +# from the Free Software Foundation by visiting their web site +# (http://www.fsf.org/) or by writing to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import glob +import os +import stat +import subprocess +import sys + +app_path = sys.argv[0] + +# print a message to stderr +def logError(s): + sys.stderr.write('%s: %s\n' % (app_path, s)) + +# this install script should not be used on Windows +if os.name == 'nt': + logError('Wrong platform. Use scripts from the "windows-installer" directory instead.') + sys.exit(1) + +# reset the umask so files we create will have the expected permissions +os.umask(stat.S_IWGRP | stat.S_IWOTH) + +# option defaults +options = { 'destdir': '/', + 'prefix': '/usr/local/', + 'sysconfdir': '/etc/', + 'examplesdir': '${sysconfdir}', + 'mandir': '${prefix}/share/man/', + 'pythonbin': '/usr/bin/env python' } +install = True +files_only = False + +# process --help option +if len(sys.argv) == 2 and sys.argv[1] == '--help': + print """Usage: %s [OPTION...] + +Install or remove Diffuse. + +Options: + --help + print this help text and quit + + --remove + remove the program + + --destdir=PATH + path to the installation's root directory + default: %s + + --prefix=PATH + common installation prefix for files + default: %s + + --sysconfdir=PATH + directory for installing read-only single-machine data + default: %s + + --examplesdir=PATH + directory for example configuration files + default: %s + + --mandir=PATH + directory for man pages + default: %s + + --pythonbin=PATH + command for python interpreter + default: %s + + --files-only + only install/remove files; skip the post install/removal tasks""" % (app_path, options['destdir'], options['prefix'], options['sysconfdir'], options['examplesdir'], options['mandir'], options['pythonbin']) + sys.exit(0) + +# returns the list of components used in a path +def components(s): + return [ p for p in s.split(os.sep) if p != '' ] + +# returns a relative path from 'src' to 'dst' +def relpath(src, dst): + s1, s2, i = components(src), components(dst), 0 + while i < len(s1) and i < len(s2) and s1[i] == s2[i]: + i += 1 + s = [ os.pardir ] * (len(s1) - i) + s.extend(s2[i:]) + return os.sep.join(s) + +# apply a set of text substitution rules on a string +def replace(s, rules, i=0): + if i < len(rules): + k, v = rules[i] + a = s.split(k) + for j in range(len(a)): + a[j] = replace(a[j], rules, i + 1) + s = v.join(a) + return s + +# create directories +def createDirs(d): + p = os.sep + for c in components(d): + p = os.path.join(p, c) + if not os.path.isdir(p): + os.mkdir(p) + +# remove a file +def removeFile(f): + try: + os.unlink(f) + except OSError: + logError('Error removing "%s".' % (f, )) + +# install/remove sets of files +def processFiles(install, dst, src, template): + for k, v in template.items(): + for s in glob.glob(os.path.join(src, k)): + d = s.replace(src, dst, 1) + if install: + createDirs(os.path.dirname(d)) + # install file + f = open(s, 'rb') + c = f.read() + f.close() + if v is not None: + c = replace(c, v) + print 'Installing %s' % (d, ) + f = open(d, 'wb') + f.write(c) + f.close() + if k == 'bin/diffuse': + # turn on the execute bits + os.chmod(d, 0755) + else: + # remove file + removeFile(d) + +# compile .po files and install +def processTranslations(install, dst): + for s in glob.glob('translations/*.po'): + lang = s[13:-3] + d = os.path.join(dst, 'share/locale/%s/LC_MESSAGES/diffuse.mo' % (lang, )) + if install: + # install file + try: + print 'Installing %s' % (d, ) + createDirs(os.path.dirname(d)) + if subprocess.Popen(['msgfmt', '-o', d, s]).wait() != 0: + raise OSError() + except OSError: + logError('WARNING: Failed to compile "%s" localisation.' % (lang, )) + else: + # remove file + removeFile(d) + +# parse command line arguments +for arg in sys.argv[1:]: + if arg == '--remove': + install = False + elif arg == '--files-only': + files_only = True + else: + for opt in options.keys(): + key = '--%s=' % (opt, ) + if arg.startswith(key): + options[opt] = arg[len(key):] + break + else: + logError('Unknown option "%s".' % (arg, )) + sys.exit(1) + +# expand variables +for s in 'sysconfdir', 'examplesdir', 'mandir': + for k in 'prefix', 'sysconfdir': + if s != k: + options[s] = options[s].replace('${%s}' % (k, ), options[k]) + +# validate inputs +if options['destdir'] == '': + options['destdir'] = '/' +for opt in 'prefix', 'sysconfdir', 'examplesdir', 'mandir': + p = options[opt] + c = components(p) + if os.pardir in c or os.curdir in c: + logError('Bad value for option "%s".' % (opt, )) + sys.exit(1) + c.insert(0, '') + c.append('') + options[opt] = os.sep.join(c) + +destdir = options['destdir'] +prefix = options['prefix'] +sysconfdir = options['sysconfdir'] +examplesdir = options['examplesdir'] +mandir = options['mandir'] +pythonbin = options['pythonbin'] + +# tell the user what we are about to do +if install: + stage = 'install' +else: + stage = 'removal' +print '''Performing %s with: + destdir=%s + prefix=%s + sysconfdir=%s + examplesdir=%s + mandir=%s + pythonbin=%s''' % (stage, destdir, prefix, sysconfdir, examplesdir, mandir, pythonbin) + +# install files to prefix +processFiles(install, os.path.join(destdir, prefix[1:]), 'src/usr/', { + 'bin/diffuse': [ ("'../../etc/diffuserc'", repr(relpath(os.path.join(prefix, 'bin'), os.path.join(sysconfdir, 'diffuserc')))), ('/usr/bin/env python', pythonbin) ], + 'share/applications/diffuse.desktop': None, + 'share/diffuse/syntax/*.syntax': None, + 'share/gnome/help/diffuse/*/diffuse.xml': [ ('/usr/', prefix), ('/etc/', sysconfdir) ], + 'share/omf/diffuse/diffuse-*.omf': [ ('/usr/', prefix) ], + 'share/icons/hicolor/*/apps/diffuse.png': None + }) + +# install manual +processFiles(install, os.path.join(destdir, mandir[1:]), 'src/usr/share/man/', { + 'man1/diffuse.1': [ ('/usr/', prefix), ('/etc/', sysconfdir) ], + '*/man1/diffuse.1': [ ('/usr/', prefix), ('/etc/', sysconfdir) ] + }) + +# install files to sysconfdir +processFiles(install, os.path.join(destdir, examplesdir[1:]), 'src/etc/', { 'diffuserc': [ ('/etc/', sysconfdir), ('../usr', relpath(sysconfdir, prefix)) ] }) + +# install translations +processTranslations(install, os.path.join(destdir, prefix[1:])) + +if not install: + # remove directories we own + for s in 'share/omf/diffuse', 'share/gnome/help/diffuse/C', 'share/gnome/help/diffuse/ru', 'share/gnome/help/diffuse', 'share/diffuse/syntax', 'share/diffuse': + d = os.path.join(destdir, os.path.join(prefix, s)[1:]) + try: + os.rmdir(d) + except OSError: + logError('Error removing "%s".' % (d, )) + +# do post install/removal tasks +if not files_only: + print 'Performing post %s tasks.' % (stage, ) + + cmds = [ [ 'update-desktop-database' ], + [ 'gtk-update-icon-cache', os.path.join(destdir, os.path.join(prefix, 'icons/hicolor')[1:]) ] ] + if install: + cmds.append([ 'scrollkeeper-update', '-q', '-o', os.path.join(destdir, os.path.join(prefix, 'share/omf/diffuse')[1:]) ]) + else: + cmds.append([ 'scrollkeeper-update', '-q' ]) + for c in cmds: + for p in os.environ['PATH'].split(os.pathsep): + if os.path.exists(os.path.join(p, c[0])): + print ' '.join(c) + try: + if subprocess.Popen(c).wait() != 0: + raise OSError() + except OSError: + logError('WARNING: Failed to update documentation database with %s.' % (c[0], )) + break + else: + print 'WARNING: %s is not installed' % (c[0], ) diff --git a/src/etc/diffuserc b/src/etc/diffuserc new file mode 100644 index 0000000..c10ba74 --- /dev/null +++ b/src/etc/diffuserc @@ -0,0 +1,5 @@ +# /etc/diffuserc: System-wide initialisation file for Diffuse +# +# Copyright (C) 2006-2009 Derrick Moser + +import ../usr/share/diffuse/syntax/*.syntax diff --git a/src/usr/bin/diffuse b/src/usr/bin/diffuse new file mode 100755 index 0000000..0a0d087 --- /dev/null +++ b/src/usr/bin/diffuse @@ -0,0 +1,8498 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (C) 2006-2014 Derrick Moser +# +# This program is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the licence, or (at your option) any later +# version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# +# You should have received a copy of the GNU General Public License along with +# this program. You may also obtain a copy of the GNU General Public License +# from the Free Software Foundation by visiting their web site +# (http://www.fsf.org/) or by writing to the Free Software Foundation, Inc., +# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import codecs +import gettext +import locale +import os +import sys + +# use the program's location as a starting place to search for supporting files +# such as icon and help documentation +if hasattr(sys, 'frozen'): + app_path = sys.executable +else: + app_path = os.path.realpath(sys.argv[0]) +bin_dir = os.path.dirname(app_path) + +# platform test +def isWindows(): + return os.name == 'nt' + +# translation location: '../share/locale//LC_MESSAGES/diffuse.mo' +# where '' is the language key +lang = locale.getdefaultlocale()[0] +if isWindows(): + # gettext looks for the language using environment variables which + # are normally not set on Windows so we try setting it for them + for v in 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG': + if v in os.environ: + lang = os.environ[v] + # remove any additional languages, encodings, or modifications + for v in ':.@': + lang = lang.split(v)[0] + break + else: + if lang is not None: + os.environ['LANG'] = lang + del v + locale_dir = 'locale' +else: + locale_dir = '../share/locale' +locale_dir = os.path.join(bin_dir, locale_dir) +gettext.bindtextdomain('diffuse', locale_dir) + +gettext.textdomain('diffuse') +_ = gettext.gettext + +APP_NAME = 'Diffuse' +VERSION = '0.4.8' +COPYRIGHT = _('Copyright © 2006-2014 Derrick Moser') +WEBSITE = 'http://diffuse.sourceforge.net/' + +# print a UTF-8 string using the host's native encoding +def printMessage(s): + try: + print codecs.encode(unicode(s, 'utf_8'), sys.getfilesystemencoding()) + except UnicodeEncodeError: + pass + +# process help options +if __name__ == '__main__': + args = sys.argv + argc = len(args) + if argc == 2 and args[1] in [ '-v', '--version' ]: + printMessage('%s %s\n%s' % (APP_NAME, VERSION, COPYRIGHT)) + sys.exit(0) + if argc == 2 and args[1] in [ '-h', '-?', '--help' ]: + printMessage(_('''Usage: + diffuse [ [OPTION...] [FILE...] ]... + diffuse ( -h | -? | --help | -v | --version ) + +Diffuse is a graphical tool for merging and comparing text files. Diffuse is +able to compare an arbitrary number of files side-by-side and gives users the +ability to manually adjust line matching and directly edit files. Diffuse can +also retrieve revisions of files from Bazaar, CVS, Darcs, Git, Mercurial, +Monotone, RCS, Subversion, and SVK repositories for comparison and merging. + +Help Options: + ( -h | -? | --help ) Display this usage information + ( -v | --version ) Display version and copyright information + +Configuration Options: + --no-rcfile Do not read any resource files + --rcfile Specify explicit resource file + +General Options: + ( -c | --commit ) File revisions and + ( -D | --close-if-same ) Close all tabs with no differences + ( -e | --encoding ) Use to read and write files + ( -L | --label )