Patchwork [6,of,7] help: don't search randomly for help data - trust util.datapath

login
register
mail settings
Submitter Mads Kiilerich
Date Sept. 28, 2014, 3:03 p.m.
Message ID <eccbabf21e878d6ad4aa.1411916583@localhost.localdomain>
Download mbox | patch
Permalink /patch/6009/
State Accepted
Headers show

Comments

Mads Kiilerich - Sept. 28, 2014, 3:03 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1411916267 -7200
#      Sun Sep 28 16:57:47 2014 +0200
# Node ID eccbabf21e878d6ad4aacc5168e2f3bd0be758f0
# Parent  8ab3da1c749ebbb3a1b7111ebccbffb2a497b600
help: don't search randomly for help data - trust util.datapath

The search was introduced in c904e76e3834 without a convincing explanation why
it should be necessary ... except for consistency with templater handling.

Now, just keep it simple.

Patch

diff --git a/mercurial/help.py b/mercurial/help.py
--- a/mercurial/help.py
+++ b/mercurial/help.py
@@ -129,11 +129,7 @@  def loaddoc(topic):
     """Return a delayed loader for help/topic.txt."""
 
     def loader():
-        for dir in ('.', '..'):
-            docdir = os.path.join(util.datapath, dir, 'help')
-            if os.path.isdir(docdir):
-                break
-
+        docdir = os.path.join(util.datapath, 'help')
         path = os.path.join(docdir, topic + ".txt")
         doc = gettext(util.readfile(path))
         for rewriter in helphooks.get(topic, []):