[PATCH 1 of 3] Update mercurial.ini file packaged in win32 installer

Pascal Quantin pascal.quantin at gmail.com
Thu Jan 15 07:26:18 CST 2009


# HG changeset patch
# User Pascal Quantin <pascal.quantin at wavecom.com>
# Date 1232025569 -3600
# Node ID 5fa9bc8ea470af083cf28ab3b60f82b3274908ec
# Parent  f7256cd9beffe9efd85957368781a88171ed9977
Update mercurial.ini file packaged in win32 installer

Update contrib/win32/mercurial.ini file with contrib/sample.hgrc
content and append contrib/mergetools.hgrc content during installation

diff --git a/contrib/win32/mercurial.ini b/contrib/win32/mercurial.ini
--- a/contrib/win32/mercurial.ini
+++ b/contrib/win32/mercurial.ini
@@ -6,6 +6,14 @@
 [ui]
 editor = notepad

+; show changed files and be a bit more verbose if True
+; verbose = True
+
+; username data to appear in commits
+; it usually takes the form: Joe User <joe.user at host.com>
+; username = Joe User <j.user at example.com>
+
+
 ; By default, we try to encode and decode all files that do not
 ; contain ASCII NUL characters.  What this means is that we try to set
 ; line endings to Windows style on update, and to Unix style on
@@ -39,3 +47,5 @@
 ; you want decoded (any you omit will be left untouched), like this:

 ; **.txt = dumbdecode:
+
+
diff --git a/contrib/win32/mercurial.iss b/contrib/win32/mercurial.iss
--- a/contrib/win32/mercurial.iss
+++ b/contrib/win32/mercurial.iss
@@ -2,7 +2,7 @@
 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

 [Setup]
-AppCopyright=Copyright 2005-2008 Matt Mackall and others
+AppCopyright=Copyright 2005-2009 Matt Mackall and others
 AppName=Mercurial
 AppVerName=Mercurial snapshot
 InfoAfterFile=contrib/win32/postinstall.txt
@@ -32,7 +32,8 @@
 Source: contrib\vim\*.*; DestDir: {app}/Contrib/Vim
 Source: contrib\zsh_completion; DestDir: {app}/Contrib
 Source: contrib\win32\ReadMe.html; DestDir: {app}; Flags: isreadme
-Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName:
Mercurial.ini; Flags: confirmoverwrite
+Source: contrib\mergetools.hgrc; DestDir: {tmp};
+Source: contrib\win32\mercurial.ini; DestDir: {app}; DestName:
Mercurial.ini; Check: CheckFile; AfterInstall: ConcatenateFiles;
 Source: contrib\win32\postinstall.txt; DestDir: {app}; DestName:
ReleaseNotes.txt
 Source: dist\hg.exe; DestDir: {app}; AfterInstall: Touch('{app}\hg.exe.local')
 Source: dist\library.zip; DestDir: {app}
@@ -66,6 +67,31 @@
 Type: files; Name: "{app}\hg.exe.local"

 [Code]
+var
+  WriteFile: Boolean;
+  CheckDone: Boolean;
+
+function CheckFile(): Boolean;
+begin
+  if not CheckDone then begin
+    WriteFile := True;
+    if FileExists(ExpandConstant(CurrentFileName)) then begin
+        WriteFile := MsgBox('' + ExpandConstant(CurrentFileName) + ''
#13#13 'The file already exists.' #13#13 'Would you like Setup to
overwrite it?', mbConfirmation, MB_YESNO) = idYes;
+    end;
+    CheckDone := True;
+  end;
+  Result := WriteFile;
+end;
+
+procedure ConcatenateFiles();
+var
+  MergeConfigs: TArrayOfString;
+begin
+  if LoadStringsFromFile(ExpandConstant('{tmp}\mergetools.hgrc'),MergeConfigs)
then begin
+    SaveStringsToFile(ExpandConstant(CurrentFileName),MergeConfigs,True);
+  end;
+end;
+
 procedure Touch(fn: String);
 begin
   SaveStringToFile(ExpandConstant(fn), '', False);


More information about the Mercurial-devel mailing list