Angel Ezquerra avatar Angel Ezquerra committed 18892a0

Honor the configuration file priority while loading the projrc file settings

Comments (0)

Files changed (1)

 """
 
 import os, sys, fnmatch
+from operator import itemgetter
 from mercurial import hg, extensions, pushkey, config, util, error
 from mercurial import commands, dispatch, cmdutil
 from mercurial.i18n import _
         for key, value in cfg.items(section):
             src = cfg.source(section, key)
             items.append((classifycfgpath(src), key, value, src))
-        items.sort() # list.sort implements a stable sort
+        # sort the config items according to their cfg file priority
+        items.sort(key=itemgetter(0)) # list.sort implements a stable sort
         for order, key, value, src in items:
             cfg.set(section, key, value, src)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.