diff --git a/docker/scripts/create-installation-tarball.sh b/docker/scripts/create-installation-tarball.sh index e011b65d..b9f37e15 100755 --- a/docker/scripts/create-installation-tarball.sh +++ b/docker/scripts/create-installation-tarball.sh @@ -75,6 +75,7 @@ install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/utils install -d ${DBDESTDIR}/${LIB}/Mercurial/mercurial/upgrade_utils install -d ${DBDESTDIR}/${LIB}/MercurialExtensions install -d ${DBDESTDIR}/${LIB}/MercurialExtensions/fixutf8 +install -m 755 Mercurial/chg ${DBDESTDIR}/${LIB}/Mercurial install -m 755 Mercurial/hg ${DBDESTDIR}/${LIB}/Mercurial install -m 644 Mercurial/mercurial.ini ${DBDESTDIR}/${LIB}/Mercurial install -m 644 Mercurial/hgdemandimport/*.* ${DBDESTDIR}/${LIB}/Mercurial/hgdemandimport diff --git a/lfmergeqm-background.sh b/lfmergeqm-background.sh index 541d2304..55a72db8 100644 --- a/lfmergeqm-background.sh +++ b/lfmergeqm-background.sh @@ -5,6 +5,6 @@ while : do - sudo -H -u www-data lfmergeqm + sudo -H --preserve-env=CHORUS_HG_EXE -u www-data lfmergeqm sleep 86400 done diff --git a/lfmergeqm-looping.sh b/lfmergeqm-looping.sh index c10f0973..790824c0 100644 --- a/lfmergeqm-looping.sh +++ b/lfmergeqm-looping.sh @@ -10,7 +10,7 @@ trap "exit" TERM # This is expected to run as the CMD, launched by the entry point. while inotifywait -e close_write /var/lib/languageforge/lexicon/sendreceive/syncqueue; do - sudo -H -u www-data lfmergeqm + sudo -H --preserve-env=CHORUS_HG_EXE -u www-data lfmergeqm # Run it again just to ensure that any initial clones that missed a race condition have a chance to get noticed - sudo -H -u www-data lfmergeqm + sudo -H --preserve-env=CHORUS_HG_EXE -u www-data lfmergeqm done diff --git a/src/LfMerge.Core.Tests/Actions/SynchronizeActionBridgeIntegrationTests.cs b/src/LfMerge.Core.Tests/Actions/SynchronizeActionBridgeIntegrationTests.cs index 09c6dd34..06335528 100644 --- a/src/LfMerge.Core.Tests/Actions/SynchronizeActionBridgeIntegrationTests.cs +++ b/src/LfMerge.Core.Tests/Actions/SynchronizeActionBridgeIntegrationTests.cs @@ -93,21 +93,6 @@ public void Teardown() } } - [Test] - public void MissingFwDataFixer_Throws() - { - // Setup - var tmpFolder = Path.Combine(_languageDepotFolder.Path, "WorkDir"); - Directory.CreateDirectory(tmpFolder); - Directory.SetCurrentDirectory(tmpFolder); - - // Execute/Verify - Assert.That(() => _synchronizeAction.Run(_lfProject), - // This can't happen in real life because we ensure that we have a clone - // before we call sync. Therefore it is acceptable to get an exception. - Throws.TypeOf()); - } - [Test] public void Error_NoHgRepo() { diff --git a/src/LfMerge.Core/LfMerge.Core.csproj b/src/LfMerge.Core/LfMerge.Core.csproj index 10420a79..3e60a9da 100644 --- a/src/LfMerge.Core/LfMerge.Core.csproj +++ b/src/LfMerge.Core/LfMerge.Core.csproj @@ -41,10 +41,10 @@ See full changelog at https://github.com/sillsdev/LfMerge/blob/develop/CHANGELOG - - - - + + + + diff --git a/src/LfMerge/Program.cs b/src/LfMerge/Program.cs index e48eb6ec..15dfbe63 100644 --- a/src/LfMerge/Program.cs +++ b/src/LfMerge/Program.cs @@ -40,6 +40,9 @@ public static int Main(string[] args) MainClass.Logger.Notice("LfMerge {2} (database {0}) starting with args: {1}", MainClass.ModelVersion, string.Join(" ", args), MainClass.GetVersionInfo("SemVer")); + // chg internal logic for finding hg trips up on LfMerge's unconvential path to hg, so we need to tell it where to find hg + Environment.SetEnvironmentVariable("CHGHG", $"/usr/lib/lfmerge/{MainClass.ModelVersion}/Mercurial/hg"); + if (string.IsNullOrEmpty(options.ProjectCode)) { MainClass.Logger.Error("Command line doesn't contain project code - exiting."); diff --git a/src/LfMergeQueueManager/QueueManager.cs b/src/LfMergeQueueManager/QueueManager.cs index 4d5271f0..c7544dfa 100644 --- a/src/LfMergeQueueManager/QueueManager.cs +++ b/src/LfMergeQueueManager/QueueManager.cs @@ -27,7 +27,7 @@ public static void Main(string[] args) if (options == null) return; - MainClass.Logger.Notice("LfMergeQueueManager starting with args: {0}", string.Join(" ", args)); + MainClass.Logger.Notice("LfMergeQueueManager starting with CHORUS_HG_EXE value \"{1}\" and args: {0}", string.Join(" ", args), Environment.GetEnvironmentVariable("CHORUS_HG_EXE") ?? ""); // initialize the SLDR Sldr.Initialize();