This is an archive of the discontinued Mercurial Phabricator instance.

packaging: rename hgrc.d to defaultrc for Windows config files next to the exe
ClosedPublic

Authored by mharbison72 on Jan 24 2020, 1:43 AM.

Details

Summary

The code and the help still says that it will read hgrc.d next to the
executable. But this directory needs to exist to read the resource based config
files. Otherwise even hg version errors out:

$ /c/Program\ Files/Mercurial/hg.exe version
Traceback (most recent call last):
  File "hg", line 43, in <module>
  File "mercurial\dispatch.pyc", line 110, in run
  File "mercurial\dispatch.pyc", line 226, in dispatch
  File "mercurial\ui.pyc", line 308, in load
  File "mercurial\rcutil.pyc", line 99, in rccomponents
  File "mercurial\rcutil.pyc", line 69, in default_rc_resources
  File "mercurial\utils\resourceutil.pyc", line 84, in contents
WindowsError: [Error 3] The system cannot find the path specified: 'c:\\Program Files\\mercurial\\defaultrc\\*.*'

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mharbison72 created this revision.Jan 24 2020, 1:43 AM

I left out the hgrc.d references in these places, because they seem to reference global hgrc.d, and not the one next to the executable.

  • contrib/plan9/proto
  • contrib/plan9/mkfile
  • contrib/packaging/debian/rules
  • contrib/packaging/mercurial.spec

I think we still need to figure out if we need to update the documentation to reference the new resource directory, and/or drop the hgrc.d next to the executable. But these changes at least let hg version and hg config run. I didn't go about disabling all of the other config files that get read in after these default config files.

CC @indygreg and @martinvonz because it's really late and I have no idea if I'm missing something.

This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.