Commit Graph

139 Commits

Author SHA1 Message Date
Guillaume Munch
0cb85e9206 Disable edition when external modifications are detected
Introduce a distinction between being read-only and having the read-only flag. A
buffer is read-only if either it has been externally modified or if it has the
read-only flag.
2017-03-11 00:50:57 +01:00
Jean-Marc Lasgouttes
a4e7114d98 Typo 2016-10-19 11:21:02 +02:00
Stephan Witt
ac4cca6ed4 Fix missing includes after change 670efa8f64 2016-07-04 12:11:24 +02:00
Richard Heck
355395174b Mark a number of coverity false positives.
Fixes coverity #23284, 23285, 23286, 23287, 23289.
2016-06-11 23:09:30 -04:00
Stephan Witt
89985bebf9 #9940 VCS now toggles buffer read-only state if locking is not active and it is enabled by VC backend 2016-02-20 07:32:56 +01:00
Stephan Witt
faef2f93dd fix GIT - version control for LyX documents not detected 2016-01-17 08:03:57 +01:00
Uwe Stöhr
5fe5ae3e80 VCBackend.cpp: addendum to [f51d7fdd/lyxgit] 2015-07-16 21:10:50 +02:00
Enrico Forestieri
306b136cc0 Fix bug #4812 (Layout in local directory lost on Save As, Copying)
The "save-as" part of the bug is fixed by extending the \textclass tag
such that, if a local layout file is used, its path relative to the
document directory is now stored together with the name. If a relative
path cannot be used, an absolute one is used but, in this case, the
document is not usable on a different platform.

The "copy" part is fixed by introducing a new \origin tag, which is
written when the file is saved. This tag stores the absolute path of
the document directory. If the document is manually copied to a
different location, the local layout file is retrivied by using
\origin (which is only updated on save).
This new tag may prove useful also for locating other files when the
document is manually moved to a different directory.

As in the original implementation the files needed for the layout
(for example, a latex class) had to be in the same directory as the
layout file, this directory has also to be added to TEXINPUTS.
2015-05-13 22:02:13 +02:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Georg Baum
06cfd26d5e Fix return value of CVS::toString() + cosmetics
CVS::toString() returns a docstring, so rather be explicit than relying on a
cast that not everybody understands how it works at first sight.
2014-11-30 12:41:49 +01:00
Georg Baum
f09a9fe2e6 Remove unsafe method FileName::tempName()
FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
2014-06-09 13:05:50 +02:00
Pavel Sanda
154319d063 Remove some header leftovers based on Scott's script hints.
False positive rate of hints is quite high. Although the includes can be
technically removed (due to other includes) they logically belong to the
header.
2013-05-02 00:30:16 -07:00
Pavel Sanda
fb16e5cca1 Make parameter more readable. 2013-04-13 21:56:52 -07:00
Tommaso Cucinotta
7779d46920 Replacing git status --porcelain along with output parsing, with a simple git ls-files.
git ls-files tells me straight whether or not a file-name is in the repo.
I cannot say the same of git status --porcelain.
See also discussion at: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177840.html
2013-04-11 02:04:25 +01:00
Tommaso Cucinotta
34dfe2d71e Avoid check mistakenly current folder for .git/.svn/.CVS, when going up the path checking for parents. 2013-04-11 02:04:24 +01:00
Georg Baum
ceb2303e2b Remove partial support for non-buffer files in VCS
This reverts a small part of 0526eb9d and gets rid of the double calls of
SVN::findFile() and GIT::findFile(). Please note that git detection does
currently not work because of 26dd4d0c.
2013-04-10 22:31:38 +02:00
Tommaso Cucinotta
26dd4d0c15 Now LyX correctly asks to retrieve non-existing file from GIT repo only if the file is actually registered in repo.
See also discussion at: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177840.html
2013-04-06 16:12:06 +01:00
Vincent van Ravesteijn
41843646b7 Fix monolithic build 2013-03-18 20:42:28 +01:00
Pavel Sanda
f7d47a803d git typo 2013-02-17 23:30:07 -08:00
Pavel Sanda
8ef1e2b9df Git VCS: use describe for tree revision info. 2013-02-17 23:22:50 -08:00
Pavel Sanda
6ba3e8d408 Leftover from SVN. 2013-02-09 19:50:06 -08:00
Pavel Sanda
75090250d4 Add very simple revision comparison for git.
At this moment we do not allow comparison between arbitrary hashes,
but except GUI the code is ready.
Thanks to the powerful way of git addressing we could even ask
for comparisons like '-2 weeks back' if someone wants to play
with GuiCompareHistory.
2013-02-09 19:35:22 -08:00
Georg Baum
22b7ad2b0a Implement revision info for git 2013-02-08 21:02:37 +01:00
Georg Baum
2f9ef2b98a Implement very basic git support
Only the local index is considered, no remote repo. Also getting the revision
(aka commit hash) is missing. How push and pull could be integrated with the
LyX VCS interface needs to be discussed, but the implemented functionality was
quite straight forward.
2013-02-06 22:07:31 +01:00
Georg Baum
0526eb9d47 Implement VCS copy and rename
The advantage of having this in LyX is the intelligent file name handling
of included files. Implementation as discussed on the list, but ensure also
that an attempt to use locked files fails.
2013-02-06 20:38:54 +01:00
Georg Baum
067fbe49cd Correctly delete temp files
FileName::erase() only clears the file name, if you want to delete the file
you need to call FileName::removeFile().
2013-02-06 20:38:54 +01:00
Jean-Marc Lasgouttes
14e01a92a4 Rename Path.h to PathChanger.h (actual name of the class) 2013-02-06 11:51:06 +01:00
Georg Baum
d33450a592 Fix inconsistent VCS checkin return values
It is not possible to transport the different error/abort/success conditions
of a VCS checkin through a simple empty or nonempty string. Therefore it was
no wonder that the return values were used inconsistently for different VCS.
Now the log and return status are decoupled, and all VCS are handled
consistently. This is a prerequisite for proper locking detection of the
upcoming rename command.
2013-02-04 22:01:59 +01:00
Georg Baum
e82cc5d498 Fix typos 2013-02-03 19:55:44 +01:00
Georg Baum
9d99d3dbea Implement extractFromVC() for CVS and SVN.
Both cvs and svn are able to retrieve non-existing files from repository,
but this was only implemented for rcs. This is a prerequisite for the
planned move and copy VCV operations. I also improved error schecking and
used extractFromVC() also for files specified on the command line if they
do not exist (in GUI mode, it was already the case in non-GUI mode).
2012-11-15 22:01:19 +01:00
Georg Baum
56e3d2153f Get rid of redundant CVS/SVN file_ member
It did always point to the buffer's file name, so it is not needed and it was
not used in most cases anyway. Instead, ensure that owner_ is always set and
cannot be changed later.
2012-11-13 21:44:36 +01:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Pavel Sanda
f4fe5a8fa0 Another attempt at #8295.
This bug occur only at certain Qt versions and systems and we do
not really understand what is going on.

Quoting Stephan - the parent path of "." e.g. never should be ".".
The inconsistency between the name of FileName and the internal QFileInfo
state looks very dangerous.
2012-08-16 20:33:43 +02:00
Stephan Witt
2ecc895775 ensure VCS::checkparentdirs() starts with an absolute path (ticket #8295) 2012-08-16 13:47:27 +02:00
Stephan Witt
4f1fb3f6d1 add debug messages to VCS::checkparentdirs (ticket #8295) 2012-08-15 17:50:24 +02:00
Stephan Witt
8be18455fd #7855 subversion 1.7.x support: use svn info to check if a file is under version control; this works for 1.6.x too; to avoid excessive forks of child processes check for the existence of a .svn directory in current dir and parent directories
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40911 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-11 11:12:12 +00:00
Pavel Sanda
d958d89b35 VCS: RCS implementation for date and author insetinfo was missing.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39231 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-02 13:08:36 +00:00
Pavel Sanda
c5220d3945 VCS: copy-paste error, these functions return bool.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39228 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-02 11:43:51 +00:00
Enrico Forestieri
1717ef203c Introduce the possibility of setting a prefix for the TEXINPUTS environment
variable. This is done in the preferences, much like as the PATH prefix.
A single '.' in the paths will get replaced with the current document dir
and also non-absolute paths will be prefixed with that dir.

The default semantics of TEXINPUTS apply, such that, for example, if a
path is terminated with a double slash, all subdirectories will be also
searched by both the TeX engine and ancillary programs such as dvi
previewers or dvips. As an example, if the prefix is set to ".:figs", the
TEXINPUTS variable will be set as ".:<docdir>:<docdir>/figs:$ORIGTEXINPUTS",
where <docdir> is the document directory.

The initial '.' is necessary to address the actual current dir (this will
be the temp dir at preview time), while if TEXINPUTS was initially unset,
such that $ORIGTEXINPUTS is empty, a colon (or semicolon on Windows) will
end the path list. This is very important, because we don't want to replace
the system directories but to complement them and, in order to do that, an
empty element has to be present in the list. Indeed, according to the
TEXINPUTS semantics, an empty element means the standard search path.
This works whether TEXINPUTS is originally set or not, because if the
original TEXINPUTS starts with a colon (meaning that the standard search
path is wanted there) we will have an empty element at that point,
otherwise the final colon will simply serve as a path separator.

Of course, on Windows a ';' has to be used as a path separator. LyX will
take care of transforming the platform path list into one understandable
by the TeX engine. For example, this will be the case for a Cygwin version
of LyX using a native Windows TeX engine or viceversa. I tested all of
this and it works for me.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38681 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-09 23:25:51 +00:00
Pavel Sanda
d4fb2ac2ac Stephan, I changed this string since the previous version was strange.
If you have better version, improve it ;)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36611 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-30 00:23:34 +00:00
Stephan Witt
2c7a7e72c2 implementation for "Compare with older revision" for CVS, correct return value of SVN::prepareFileRevision for failure to create tmp file
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36161 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 12:18:09 +00:00
Stephan Witt
ba00acbd65 check for user cancel or errors on vcs revert before reload of buffer in LFUN_VC_REVERT
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36160 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 11:54:08 +00:00
Pavel Sanda
c9332413e5 Quickfix closing #6396.
sleep sleep


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36154 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 02:38:35 +00:00
Pavel Sanda
69520456e0 Fix RCS part of #6396. Btw revert is slightly broken now...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36153 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 02:21:04 +00:00
Stephan Witt
69dd56d6c4 CVS implementation for buffer-info vcs-author, cvs-date and cvs-time
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36148 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-06 00:20:42 +00:00
Pavel Sanda
f5123ccfa8 Add comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36003 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-02 19:54:08 +00:00
Stephan Witt
85b1bba640 in client server mode CVS does not like full path operand for directory operation; LyX is in the repo dir already, so "." is used as target
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35836 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 17:49:45 +00:00
Stephan Witt
c6d4080694 #6396 no dialog when no doc changes were done and check-in or revert is done
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35828 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 13:27:48 +00:00
Stephan Witt
bcbe6ae960 * implementation of status check and use it for checkIn and revert.
helps the user to avoid errors and leads to more informative messages.
* implementation of diff and use it for the repoUpdate operation.
* add the check for merge conflicts in checkOut.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35813 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 05:37:04 +00:00
Stephan Witt
db16795b32 whitespace correction
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35627 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 16:01:06 +00:00