With the current team project implementation the following can happen:
TEAM_NOCHECKOUT message, which is fairly scary and confusing. A full-project sync is not performed, so user B does not see the changes to the source.The cause is at step 2: RealProject.rebaseProject() is called on close, and because it uses ProjectTMX.exportTMX() to back up the current project TM the backup TMX's version header reads "OmegaT 3.5.B" while the original was "OmegaT 3.5.A". This change is not synced to the server, and prevents proper syncing on the next open.
The following diff illustrates a potential fix: Copy the file instead of using exportTMX().
diff --git a/src/org/omegat/core/data/RealProject.java b/src/org/omegat/core/data/RealProject.java
index 9a9de07..31e4762 100644
--- a/src/org/omegat/core/data/RealProject.java
+++ b/src/org/omegat/core/data/RealProject.java
@@ -88,6 +88,7 @@ import org.omegat.tokenizer.DefaultTokenizer;
import org.omegat.tokenizer.ITokenizer;
import org.omegat.util.DirectoryMonitor;
import org.omegat.util.FileUtil;
+import org.omegat.util.LFileCopy;
import org.omegat.util.Language;
import org.omegat.util.Log;
import org.omegat.util.OConsts;
@@ -814,7 +815,7 @@ public class RealProject implements IProject {
// save into ".new" file
filenameTMXwithLocalChangesOnBase = new File(projectTMXFilename + "-based_on_" + baseRevTMX + OConsts.NEWFILE_EXTENSION);
filenameGlossarywithLocalChangesOnBase = null;
- projectTMX.exportTMX(m_config, filenameTMXwithLocalChangesOnBase, false, false, true); //overwrites file if it exists
+ LFileCopy.copy(projectTMXFile, filenameTMXwithLocalChangesOnBase); //overwrites file if it exists
if (System.getProperty("team.supersafe") != null) {
// save supersafe backup
File bak = new File(projectTMXFilename + "-based_on_" + baseRevTMX + "_at_"
Since the team project implementation will change greatly in 3.6, I will not commit this change to trunk. This ticket is intented to serve as a reminder to address this issue if it is still present in the new implementation.
A different potential fix that would work regardless of team implementation: Don't do team sync on project close if the project has not been modified.
I also like the second fix better because the first fix makes the
project_save.tmxfile the "true" TM instead of the in-memory representation.The second fix sounds good.
Not only it solves the issue, but it also saves significant time on a slow connection.
Isn't it worth committing to /trunk?
Didier
One annoyance with the second fix is that it can leave some other version-controlled files modified:
omegat/filters.xmlfrom OmegaT version X.filters.xmlupon opening the project.filters.xmlis reset to committed version on everyrebaseProject(). But with the second fix above, opening and closing project without making changes leavesfilters.xmlmodified.The same issue can happen with
omegat.project: my projects were created before<source_dir_excludes>was added, soomegat.projectis left with this still modified after close.Last edit: Aaron Madlon-Kay 2015-10-16
As I thought, there is the potential for conflicts here with svn:
filters.xmlis modified with default settings for newly added filters, per situation above.filters.xmlwith non-default settings for these added filters.filters.xmlwill be in a conflicted state, and will fail to load. This results in default filter settings.filters.xmlcan be restored to a normal state without special intervention is byrebaseProject(), but this now requires the user to manually save the project or wait for autosave, and then reload to get the correct filter settings loaded.The solution for this would be for
SVNRemoteRepository.updateFullProject()to do aresetin addition to anupdate.Last edit: Aaron Madlon-Kay 2015-10-16
Even if we have
updateFullProjectdo areset, it is still the case that simply opening and closing the project leaves it in a needlessly modified state. What we really want is forrebaseProjectto not leave the project modified if everything went smoothly (we are online and had no errors).For my purposes, then, the solution is to
resetat the end ofrebaseProjectif we are online (if we are offline we must not reset).Last edit: Aaron Madlon-Kay 2015-10-19
This appears to have been addressed in [feature-requests:#1189].
Related
Feature Requests:
#1189