Patchwork D7624: rcutil: don't check if defaultrc/ is a directory -- we know it is

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 11:44 p.m.
Message ID <differential-rev-PHID-DREV-e3poitnodnnodwwdpxqy-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43765/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2019, 11:44 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/rcutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 17, 2019, 11:48 a.m.
pulkit added a comment.


  I am unable to find some code or understand the reasoning behind `-- we know this` part.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Dec. 17, 2019, 1:24 p.m.
martinvonz added a comment.


  In D7624#112964 <https://phab.mercurial-scm.org/D7624#112964>, @pulkit wrote:
  
  > I am unable to find some code or understand the reasoning behind `-- we know this` part.
  
  `defaultrc/` is a directory in the mercurial repo (`mercurial/defaultrc/`). We also don't convert it to a file when packaging, so it will remain the same directory in an installed mercurial.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel
phabricator - Dec. 17, 2019, 2:14 p.m.
martinvonz added a comment.


  In D7624#112995 <https://phab.mercurial-scm.org/D7624#112995>, @martinvonz wrote:
  
  > In D7624#112964 <https://phab.mercurial-scm.org/D7624#112964>, @pulkit wrote:
  >
  >> I am unable to find some code or understand the reasoning behind `-- we know this` part.
  >
  > `defaultrc/` is a directory in the mercurial repo (`mercurial/defaultrc/`). We also don't convert it to a file when packaging, so it will remain the same directory in an installed mercurial.
  
  I'll add more detail to the commit message in a bit.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/rcutil.py b/mercurial/rcutil.py
--- a/mercurial/rcutil.py
+++ b/mercurial/rcutil.py
@@ -63,11 +63,8 @@ 
 
 def defaultrcpath():
     '''return rc paths in defaultrc'''
-    path = []
     defaultpath = os.path.join(resourceutil.datapath, b'defaultrc')
-    if os.path.isdir(defaultpath):
-        path = _expandrcpath(defaultpath)
-    return path
+    return _expandrcpath(defaultpath)
 
 
 def rccomponents():