# HG changeset patch # User Mads Kiilerich # Date 1395193514 -3600 # Node ID d19c9bdbbf35541fd50787d4b3f9081f3527bb1d # Parent f144928dd058e9d9de759e03b37701281f32c665 config: don't set source when no source is specified - don't overwrite with '' This prevents ui.fixconfig from overwriting the source of paths and it will thus show up in showconfig --debug. diff -r f144928dd058 -r d19c9bdbbf35 mercurial/config.py --- a/mercurial/config.py Wed Mar 19 02:45:04 2014 +0100 +++ b/mercurial/config.py Wed Mar 19 02:45:14 2014 +0100 @@ -93,7 +93,8 @@ if section not in self: self._data[section] = sortdict() self._data[section][item] = value - self._source[(section, item)] = source + if source: + self._source[(section, item)] = source def restore(self, data): """restore data returned by self.backup""" diff -r f144928dd058 -r d19c9bdbbf35 tests/test-hgrc.t --- a/tests/test-hgrc.t Wed Mar 19 02:45:04 2014 +0100 +++ b/tests/test-hgrc.t Wed Mar 19 02:45:14 2014 +0100 @@ -201,3 +201,14 @@ --verbose: ui.verbose=False --debug: ui.debug=True --quiet: ui.quiet=False + +source of paths is not mangled + + $ cat >> $HGRCPATH < [paths] + > foo = bar + > EOF + $ hg showconfig --debug paths + plain: True + read config from: $TESTTMP/hgrc + $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar