Patchwork D7171: packaging: write out editor.rc in Python

login
register
mail settings
Submitter phabricator
Date Nov. 11, 2019, 9:09 p.m.
Message ID <1ad5da0b5a030a7df12f3a0d8dcda3f5@localhost.localdomain>
Download mbox | patch
Permalink /patch/43127/
State Not Applicable
Headers show

Comments

phabricator - Nov. 11, 2019, 9:09 p.m.
Closed by commit rHG8aa6aa9b7843: packaging: write out editor.rc in Python (authored by indygreg).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7171?vs=17405&id=18024

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7171/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7171

AFFECTED FILES
  contrib/packaging/hgpackaging/py2exe.py
  contrib/packaging/inno/mercurial.iss

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/contrib/packaging/inno/mercurial.iss b/contrib/packaging/inno/mercurial.iss
--- a/contrib/packaging/inno/mercurial.iss
+++ b/contrib/packaging/inno/mercurial.iss
@@ -48,7 +48,6 @@ 
 
 [INI]
 Filename: {app}\Mercurial.url; Section: InternetShortcut; Key: URL; String: https://mercurial-scm.org/
-Filename: {app}\hgrc.d\editor.rc; Section: ui; Key: editor; String: notepad
 
 [UninstallDelete]
 Type: files; Name: {app}\Mercurial.url
diff --git a/contrib/packaging/hgpackaging/py2exe.py b/contrib/packaging/hgpackaging/py2exe.py
--- a/contrib/packaging/hgpackaging/py2exe.py
+++ b/contrib/packaging/hgpackaging/py2exe.py
@@ -217,6 +217,13 @@ 
     """
     process_install_rules(STAGING_RULES, source_dir, staging_dir)
 
+    # Write out a default editor.rc file to configure notepad as the
+    # default editor.
+    with (staging_dir / 'hgrc.d' / 'editor.rc').open(
+        'w', encoding='utf-8'
+    ) as fh:
+        fh.write('[ui]\neditor = notepad\n')
+
     # Purge any files we don't want to be there.
     for f in STAGING_EXCLUDES:
         p = staging_dir / f