# HG changeset patch # User Bryan O'Sullivan # Date 1127321790 25200 # Node ID 141951276ba1d5729a67215ae9f28fc641f87607 # Parent a942bf419a642ca360b1f9ccecc03e6cfd28e8bf Use platform-appropriate rc file names. diff -r a942bf419a64 -r 141951276ba1 mercurial/ui.py --- a/mercurial/ui.py Wed Sep 21 00:47:57 2005 -0700 +++ b/mercurial/ui.py Wed Sep 21 09:56:30 2005 -0700 @@ -14,8 +14,7 @@ interactive=True): self.overlay = {} self.cdata = ConfigParser.SafeConfigParser() - self.cdata.read([os.path.normpath(hgrc) for hgrc in - "/etc/mercurial/hgrc", os.path.expanduser("~/.hgrc")]) + self.cdata.read(util.rcpath) self.quiet = self.configbool("ui", "quiet") self.verbose = self.configbool("ui", "verbose") diff -r a942bf419a64 -r 141951276ba1 mercurial/util.py --- a/mercurial/util.py Wed Sep 21 00:47:57 2005 -0700 +++ b/mercurial/util.py Wed Sep 21 09:56:30 2005 -0700 @@ -45,7 +45,7 @@ if code: raise Abort("patch command failed: exit status %s " % code) return files.keys() - + def binary(s): """return true if a string is binary data using diff's heuristic""" if s and '\0' in s[:4096]: @@ -331,6 +331,9 @@ if os.name == 'nt': nulldev = 'NUL:' + rcpath = (r'c:\mercurial\mercurial.ini', + os.path.join(os.path.expanduser('~'), 'mercurial.ini')) + def parse_patch_output(output_line): """parses the output produced by patch and returns the file name""" pf = output_line[14:] @@ -383,6 +386,9 @@ else: nulldev = '/dev/null' + rcpath = map(os.path.normpath, + ('/etc/mercurial/hgrc', os.path.expanduser('~/.hgrc'))) + def parse_patch_output(output_line): """parses the output produced by patch and returns the file name""" return output_line[14:]