Patchwork D8054: resourceutil: correct the root path for file based lookup under py2exe

login
register
mail settings
Submitter phabricator
Date Jan. 31, 2020, 4:51 a.m.
Message ID <differential-rev-PHID-DREV-fk23yypk2pyniax34chl-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/44797/
State Superseded
Headers show

Comments

phabricator - Jan. 31, 2020, 4:51 a.m.
mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This silly copy/paste error caused "Mercurial" to be truncated from
  "C:\Program Files".  The fact that "helptext" and "defaultrc" are now in a
  subpackage of "mercurial" added it back on, and everything seemed to work.  But
  that broke if not installed to the default directory, and also caused TortoiseHg
  to look at Mercurial's config files instead of its own.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

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

AFFECTED FILES
  mercurial/utils/resourceutil.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/utils/resourceutil.py b/mercurial/utils/resourceutil.py
--- a/mercurial/utils/resourceutil.py
+++ b/mercurial/utils/resourceutil.py
@@ -33,7 +33,7 @@ 
 if mainfrozen() and getattr(sys, 'frozen', None) != 'macosx_app':
     # executable version (py2exe) doesn't support __file__
     datapath = os.path.dirname(pycompat.sysexecutable)
-    _rootpath = os.path.dirname(datapath)
+    _rootpath = datapath
 else:
     datapath = os.path.dirname(os.path.dirname(pycompat.fsencode(__file__)))
     _rootpath = os.path.dirname(datapath)