# HG changeset patch # User Alexis S. L. Carvalho # Date 1194650665 7200 # Node ID 6ffca2bf23da2b051d82301514495a629a2df189 # Parent b11c855cde96364fc57f29dcac1f9fa46d56fe13# Parent 0b3f910dfd17ea18eea017a51e5685742771986c merge with crew-stable diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/__init__.py --- a/hgext/convert/__init__.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/__init__.py Fri Nov 09 21:24:25 2007 -0200 @@ -33,12 +33,16 @@ ] def convertsource(ui, path, type, rev): + exceptions = [] for name, source in source_converters: try: if not type or name == type: return source(ui, path, rev) except NoRepo, inst: - ui.note(_("convert: %s\n") % inst) + exceptions.append(inst) + if not ui.quiet: + for inst in exceptions: + ui.write(_("%s\n") % inst) raise util.Abort('%s: unknown repository type' % path) def convertsink(ui, path, type): diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/cvs.py --- a/hgext/convert/cvs.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/cvs.py Fri Nov 09 21:24:25 2007 -0200 @@ -11,7 +11,7 @@ cvs = os.path.join(path, "CVS") if not os.path.exists(cvs): - raise NoRepo("couldn't open CVS repo %s" % path) + raise NoRepo("%s does not look like a CVS checkout" % path) for tool in ('cvsps', 'cvs'): checktool(tool) diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/darcs.py --- a/hgext/convert/darcs.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/darcs.py Fri Nov 09 21:24:25 2007 -0200 @@ -22,14 +22,19 @@ converter_source.__init__(self, ui, path, rev=rev) commandline.__init__(self, ui, 'darcs') - if not os.path.exists(os.path.join(path, '_darcs', 'inventory')): - raise NoRepo("couldn't open darcs repo %s" % path) + # check for _darcs, ElementTree, _darcs/inventory so that we can + # easily skip test-convert-darcs if ElementTree is not around + if not os.path.exists(os.path.join(path, '_darcs')): + raise NoRepo("%s does not look like a darcs repo" % path) checktool('darcs') if ElementTree is None: raise util.Abort(_("Python ElementTree module is not available")) + if not os.path.exists(os.path.join(path, '_darcs', 'inventory')): + raise NoRepo("%s does not look like a darcs repo" % path) + self.path = os.path.realpath(path) self.lastrev = None diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/git.py --- a/hgext/convert/git.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/git.py Fri Nov 09 21:24:25 2007 -0200 @@ -30,7 +30,7 @@ if os.path.isdir(path + "/.git"): path += "/.git" if not os.path.exists(path + "/objects"): - raise NoRepo("couldn't open GIT repo %s" % path) + raise NoRepo("%s does not look like a Git repo" % path) checktool('git-rev-parse', 'git') diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/hg.py --- a/hgext/convert/hg.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/hg.py Fri Nov 09 21:24:25 2007 -0200 @@ -187,10 +187,11 @@ self.repo = hg.repository(self.ui, path) # try to provoke an exception if this isn't really a hg # repo, but some other bogus compatible-looking url - self.repo.heads() + if not self.repo.local(): + raise hg.RepoError() except hg.RepoError: ui.print_exc() - raise NoRepo("could not open hg repo %s as source" % path) + raise NoRepo("%s is not a local Mercurial repo" % path) self.lastrev = None self.lastctx = None self._changescache = None diff -r b11c855cde96 -r 6ffca2bf23da hgext/convert/subversion.py --- a/hgext/convert/subversion.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/convert/subversion.py Fri Nov 09 21:24:25 2007 -0200 @@ -107,7 +107,7 @@ try: SubversionException except NameError: - raise NoRepo('subversion python bindings could not be loaded') + raise NoRepo('Subversion python bindings could not be loaded') self.encoding = locale.getpreferredencoding() self.lastrevs = {} @@ -136,7 +136,7 @@ self.uuid = svn.ra.get_uuid(self.ra).decode(self.encoding) except SubversionException, e: ui.print_exc() - raise NoRepo("couldn't open SVN repo %s" % self.url) + raise NoRepo("%s does not look like a Subversion repo" % self.url) if rev: try: diff -r b11c855cde96 -r 6ffca2bf23da hgext/mq.py --- a/hgext/mq.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/mq.py Fri Nov 09 21:24:25 2007 -0200 @@ -456,6 +456,7 @@ raise finally: del tr, lock, wlock + self.removeundo(repo) def _apply(self, repo, series, list=False, update_status=True, strict=False, patchdir=None, merge=None, all_files={}): @@ -527,7 +528,6 @@ self.ui.warn("fuzz found when applying patch, stopping\n") err = 1 break - self.removeundo(repo) return (err, n) def delete(self, repo, patches, opts): @@ -654,6 +654,9 @@ self.removeundo(repo) repair.strip(self.ui, repo, rev, backup) + # strip may have unbundled a set of backed up revisions after + # the actual strip + self.removeundo(repo) finally: del lock, wlock diff -r b11c855cde96 -r 6ffca2bf23da hgext/purge.py --- a/hgext/purge.py Wed Nov 07 21:13:56 2007 -0600 +++ b/hgext/purge.py Fri Nov 09 21:24:25 2007 -0200 @@ -49,6 +49,9 @@ else: ui.write('%s%s' % (name, eol)) + if not force: + _check_fs(ui, repo) + directories = [] files = [] missing = [] @@ -63,8 +66,6 @@ elif src == 'f' and f not in repo.dirstate: files.append(f) - _check_missing(ui, repo, missing, force) - directories.sort() for f in files: @@ -77,7 +78,7 @@ ui.note(_('Removing directory %s\n') % f) remove(os.rmdir, f) -def _check_missing(ui, repo, missing, force=False): +def _check_fs(ui, repo): """Abort if there is the chance of having problems with name-mangling fs In a name mangling filesystem (e.g. a case insensitive one) @@ -85,34 +86,18 @@ stored in the dirstate. This already confuses the status and add commands, but with purge this may cause data loss. - To prevent this, _check_missing will abort if there are missing - files. The force option will let the user skip the check if he - knows it is safe. - - Even with the force option this function will check if any of the - missing files is still available in the working dir: if so there - may be some problem with the underlying filesystem, so it - aborts unconditionally.""" - - found = [f for f in missing if util.lexists(repo.wjoin(f))] + To prevent this, this function will abort if there are uncommitted + changes. + """ - if found: - if not ui.quiet: - ui.warn(_("The following tracked files weren't listed by the " - "filesystem, but could still be found:\n")) - for f in found: - ui.warn("%s\n" % f) - if util.checkfolding(repo.path): - ui.warn(_("This is probably due to a case-insensitive " - "filesystem\n")) - raise util.Abort(_("purging on name mangling filesystems is not " - "yet fully supported")) - - if missing and not force: - raise util.Abort(_("there are missing files in the working dir and " - "purge still has problems with them due to name " - "mangling filesystems. " - "Use --force if you know what you are doing")) + # We can't use (files, match) to do a partial walk here - we wouldn't + # notice a modified README file if the user ran "hg purge readme" + modified, added, removed, deleted = repo.status()[:4] + if modified or added or removed or deleted: + if not util.checkfolding(repo.path) and not ui.quiet: + ui.warn(_("Purging on name mangling filesystems is not " + "fully supported.\n")) + raise util.Abort(_("outstanding uncommitted changes")) def purge(ui, repo, *dirs, **opts): @@ -158,7 +143,7 @@ (purge, [('a', 'abort-on-err', None, _('abort if an error occurs')), ('', 'all', None, _('purge ignored files too')), - ('f', 'force', None, _('purge even when missing files are detected')), + ('f', 'force', None, _('purge even when there are uncommitted changes')), ('p', 'print', None, _('print the file names instead of deleting them')), ('0', 'print0', None, _('end filenames with NUL, for use with xargs' ' (implies -p)')), diff -r b11c855cde96 -r 6ffca2bf23da mercurial/commands.py --- a/mercurial/commands.py Wed Nov 07 21:13:56 2007 -0600 +++ b/mercurial/commands.py Fri Nov 09 21:24:25 2007 -0200 @@ -1652,7 +1652,7 @@ cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, source) - ui.status(_('comparing with %s\n') % source) + ui.status(_('comparing with %s\n') % util.hidepassword(source)) if revs: revs = [other.lookup(rev) for rev in revs] incoming = repo.findincoming(other, heads=revs, force=opts["force"]) @@ -1962,7 +1962,7 @@ revs = [repo.lookup(rev) for rev in revs] other = hg.repository(ui, dest) - ui.status(_('comparing with %s\n') % dest) + ui.status(_('comparing with %s\n') % util.hidepassword(dest)) o = repo.findoutgoing(other, force=opts['force']) if not o: ui.status(_("no changes found\n")) @@ -2095,7 +2095,7 @@ cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, source) - ui.status(_('pulling from %s\n') % (source)) + ui.status(_('pulling from %s\n') % util.hidepassword(source)) if revs: try: revs = [other.lookup(rev) for rev in revs] @@ -2142,7 +2142,7 @@ cmdutil.setremoteconfig(ui, opts) other = hg.repository(ui, dest) - ui.status('pushing to %s\n' % (dest)) + ui.status('pushing to %s\n' % util.hidepassword(dest)) if revs: revs = [repo.lookup(rev) for rev in revs] r = repo.push(other, opts['force'], revs=revs) diff -r b11c855cde96 -r 6ffca2bf23da mercurial/dirstate.py --- a/mercurial/dirstate.py Wed Nov 07 21:13:56 2007 -0600 +++ b/mercurial/dirstate.py Fri Nov 09 21:24:25 2007 -0200 @@ -185,16 +185,15 @@ dirs[base] += 1 def _decpath(self, path): - if "_dirs" in self.__dict__: - c = path.rfind('/') - if c >= 0: - base = path[:c] - dirs = self._dirs - if dirs[base] == 1: - del dirs[base] - self._decpath(base) - else: - dirs[base] -= 1 + c = path.rfind('/') + if c >= 0: + base = path[:c] + dirs = self._dirs + if dirs[base] == 1: + del dirs[base] + self._decpath(base) + else: + dirs[base] -= 1 def _incpathcheck(self, f): if '\r' in f or '\n' in f: @@ -211,20 +210,29 @@ (d, f)) self._incpath(f) - def _changepath(self, f, newstate): + def _changepath(self, f, newstate, relaxed=False): # handle upcoming path changes oldstate = self[f] if oldstate not in "?r" and newstate in "?r": - self._decpath(f) + if "_dirs" in self.__dict__: + self._decpath(f) return if oldstate in "?r" and newstate not in "?r": + if relaxed and oldstate == '?': + # XXX + # in relaxed mode we assume the caller knows + # what it is doing, workaround for updating + # dir-to-file revisions + if "_dirs" in self.__dict__: + self._incpath(f) + return self._incpathcheck(f) return def normal(self, f): 'mark a file normal and clean' self._dirty = True - self._changepath(f, 'n') + self._changepath(f, 'n', True) s = os.lstat(self._join(f)) self._map[f] = ('n', s.st_mode, s.st_size, s.st_mtime, 0) if self._copymap.has_key(f): @@ -233,7 +241,7 @@ def normallookup(self, f): 'mark a file normal, but possibly dirty' self._dirty = True - self._changepath(f, 'n') + self._changepath(f, 'n', True) self._map[f] = ('n', 0, -1, -1, 0) if f in self._copymap: del self._copymap[f] @@ -241,7 +249,7 @@ def normaldirty(self, f): 'mark a file normal, but dirty' self._dirty = True - self._changepath(f, 'n') + self._changepath(f, 'n', True) self._map[f] = ('n', 0, -2, -1, 0) if f in self._copymap: del self._copymap[f] @@ -266,7 +274,7 @@ 'mark a file merged' self._dirty = True s = os.lstat(self._join(f)) - self._changepath(f, 'm') + self._changepath(f, 'm', True) self._map[f] = ('m', s.st_mode, s.st_size, s.st_mtime, 0) if f in self._copymap: del self._copymap[f] diff -r b11c855cde96 -r 6ffca2bf23da mercurial/httprepo.py --- a/mercurial/httprepo.py Wed Nov 07 21:13:56 2007 -0600 +++ b/mercurial/httprepo.py Fri Nov 09 21:24:25 2007 -0200 @@ -256,7 +256,11 @@ if user: ui.debug(_('http auth: user %s, password %s\n') % (user, passwd and '*' * len(passwd) or 'not set')) - passmgr.add_password(None, host, user, passwd or '') + netloc = host + if port: + netloc += ':' + port + # Python < 2.4.3 uses only the netloc to search for a password + passmgr.add_password(None, (self._url, netloc), user, passwd or '') handlers.extend((urllib2.HTTPBasicAuthHandler(passmgr), httpdigestauthhandler(passmgr))) diff -r b11c855cde96 -r 6ffca2bf23da mercurial/util.py --- a/mercurial/util.py Wed Nov 07 21:13:56 2007 -0600 +++ b/mercurial/util.py Fri Nov 09 21:24:25 2007 -0200 @@ -15,6 +15,7 @@ from i18n import _ import cStringIO, errno, getpass, popen2, re, shutil, sys, tempfile, strutil import os, stat, threading, time, calendar, ConfigParser, locale, glob, osutil +import re, urlparse try: set = set @@ -1698,3 +1699,33 @@ def uirepr(s): # Avoid double backslash in Windows path repr() return repr(s).replace('\\\\', '\\') + +def hidepassword(url): + '''replaces the password in the url string by three asterisks (***) + + >>> hidepassword('http://www.example.com/some/path#fragment') + 'http://www.example.com/some/path#fragment' + >>> hidepassword('http://me@www.example.com/some/path#fragment') + 'http://me@www.example.com/some/path#fragment' + >>> hidepassword('http://me:simplepw@www.example.com/path#frag') + 'http://me:***@www.example.com/path#frag' + >>> hidepassword('http://me:complex:pw@www.example.com/path#frag') + 'http://me:***@www.example.com/path#frag' + >>> hidepassword('/path/to/repo') + '/path/to/repo' + >>> hidepassword('relative/path/to/repo') + 'relative/path/to/repo' + >>> hidepassword('c:\\\\path\\\\to\\\\repo') + 'c:\\\\path\\\\to\\\\repo' + >>> hidepassword('c:/path/to/repo') + 'c:/path/to/repo' + >>> hidepassword('bundle://path/to/bundle') + 'bundle://path/to/bundle' + ''' + url_parts = list(urlparse.urlparse(url)) + host_with_pw_pattern = re.compile('^([^:]*):([^@]*)@(.*)$') + if host_with_pw_pattern.match(url_parts[1]): + url_parts[1] = re.sub(host_with_pw_pattern, r'\1:***@\3', + url_parts[1]) + return urlparse.urlunparse(url_parts) + diff -r b11c855cde96 -r 6ffca2bf23da tests/run-tests.py --- a/tests/run-tests.py Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/run-tests.py Fri Nov 09 21:24:25 2007 -0200 @@ -266,8 +266,6 @@ def skip(msg): if not verbose: skips.append((test, msg)) - sys.stdout.write('s') - sys.stdout.flush() else: print "\nSkipping %s: %s" % (test, msg) return None @@ -278,6 +276,11 @@ hgrc = file(HGRCPATH, 'w+') hgrc.write('[ui]\n') hgrc.write('slash = True\n') + hgrc.write('[defaults]\n') + hgrc.write('backout = -d "0 0"\n') + hgrc.write('commit = -d "0 0"\n') + hgrc.write('debugrawcommit = -d "0 0"\n') + hgrc.write('tag = -d "0 0"\n') hgrc.close() err = os.path.join(TESTDIR, test+".err") @@ -352,7 +355,7 @@ ret = diffret if not verbose: - sys.stdout.write('.') + sys.stdout.write(skipped and 's' or '.') sys.stdout.flush() if ret != 0 and not skipped: diff -r b11c855cde96 -r 6ffca2bf23da tests/test-alias --- a/tests/test-alias Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-alias Fri Nov 09 21:24:25 2007 -0200 @@ -1,6 +1,6 @@ #!/bin/sh -cat > $HGRCPATH <> $HGRCPATH <&1 | grep ElementTree > /dev/null; then + echo 'hghave: missing feature: elementtree module' + exit 80 +fi + echo % initialize darcs repo mkdir darcs-repo cd darcs-repo diff -r b11c855cde96 -r 6ffca2bf23da tests/test-dispatch --- a/tests/test-dispatch Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-dispatch Fri Nov 09 21:24:25 2007 -0200 @@ -11,7 +11,7 @@ echo '% [defaults]' hg cat a -cat > $HGRCPATH <> $HGRCPATH <> $HGRCPATH echo '% module/__init__.py-style' -echo '[extensions]' > $HGRCPATH echo "barfoo = $barfoopath" >> $HGRCPATH cd a hg foo +echo 'barfoo = !' >> $HGRCPATH cd .. cat > empty.py < $HGRCPATH echo "empty = $emptypath" >> $HGRCPATH hg help empty +echo 'empty = !' >> $HGRCPATH cat > debugextension.py < $HGRCPATH echo "debugextension = $debugpath" >> $HGRCPATH hg help debugextension hg --debug help debugextension +echo 'debugextension = !' >> $HGRCPATH diff -r b11c855cde96 -r 6ffca2bf23da tests/test-issue660 --- a/tests/test-issue660 Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-issue660 Fri Nov 09 21:24:25 2007 -0200 @@ -80,10 +80,15 @@ echo % should succeed - shadow removed hg add d +hg ci -md -#echo % update should work -# -#hg up -r 0 -#hg up -r 1 +echo % update should work at least with clean workdir + +rm -r a b d +hg up -r 0 +hg st --all +rm -r a b +hg up -r 1 +hg st --all exit 0 diff -r b11c855cde96 -r 6ffca2bf23da tests/test-issue660.out --- a/tests/test-issue660.out Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-issue660.out Fri Nov 09 21:24:25 2007 -0200 @@ -40,3 +40,10 @@ abort: directory 'd' already in dirstate % removing shadow % should succeed - shadow removed +% update should work at least with clean workdir +2 files updated, 0 files merged, 0 files removed, 0 files unresolved +C a +C b/b +2 files updated, 0 files merged, 0 files removed, 0 files unresolved +C a/a +C b diff -r b11c855cde96 -r 6ffca2bf23da tests/test-mq --- a/tests/test-mq Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-mq Fri Nov 09 21:24:25 2007 -0200 @@ -1,5 +1,12 @@ #!/bin/sh +checkundo() +{ + if [ -f .hg/store/undo ]; then + echo ".hg/store/undo still exists after $1" + fi +} + echo "[extensions]" >> $HGRCPATH echo "mq=" >> $HGRCPATH @@ -57,6 +64,7 @@ hg init e cd e hg qnew A +checkundo qnew echo foo > foo hg add foo hg qrefresh @@ -100,14 +108,17 @@ hg diff --nodates -q # restore things hg qrefresh +checkundo qrefresh echo % qpop hg qpop +checkundo qpop echo % qpush hg qpush +checkundo qpush cd .. @@ -394,6 +405,7 @@ hg ci -m merge -d '0 0' hg log hg strip 1 2>&1 | sed 's/\(saving bundle to \).*/\1/' +checkundo strip hg log cd .. diff -r b11c855cde96 -r 6ffca2bf23da tests/test-mq-merge --- a/tests/test-mq-merge Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-mq-merge Fri Nov 09 21:24:25 2007 -0200 @@ -7,6 +7,13 @@ sed -e 's:\\:/:g' -e 's:[^ ]*/t/::g' } +checkundo() +{ + if [ -f .hg/store/undo ]; then + echo ".hg/store/undo still exists after $1" + fi +} + echo "[extensions]" >> $HGRCPATH echo "hgext.mq=" >> $HGRCPATH @@ -25,6 +32,7 @@ # Save the patch queue so we can merge it later hg qsave -c -e 2>&1 | rewrite_path +checkundo qsave # Update b and commit in an "update" changeset hg up -C init @@ -36,6 +44,7 @@ # The system cannot find the file specified => a hg manifest hg qpush -a -m 2>&1 | rewrite_path +checkundo 'qpush -m' hg manifest # ensure status is correct after merge diff -r b11c855cde96 -r 6ffca2bf23da tests/test-permissions --- a/tests/test-permissions Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-permissions Fri Nov 09 21:24:25 2007 -0200 @@ -13,5 +13,6 @@ chmod -w .hg/store/data/a.i echo barber > a hg commit -m "2" -d "1000000 0" 2>/dev/null || echo commit failed -chmod -w ../t +chmod -w . hg diff --nodates +chmod +w . diff -r b11c855cde96 -r 6ffca2bf23da tests/test-purge --- a/tests/test-purge Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-purge Fri Nov 09 21:24:25 2007 -0200 @@ -101,6 +101,13 @@ hg revert --all --quiet ls +echo '% tracked file in ignored directory (issue621)' +echo directory >> .hgignore +hg ci -m 'ignore directory' +touch untracked_file +hg purge -p +hg purge -v + echo % skip excluded files touch excluded_file hg purge -p -X excluded_file diff -r b11c855cde96 -r 6ffca2bf23da tests/test-purge.out --- a/tests/test-purge.out Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-purge.out Fri Nov 09 21:24:25 2007 -0200 @@ -59,6 +59,9 @@ Removing file untracked_file directory r1 +% tracked file in ignored directory (issue621) +untracked_file +Removing file untracked_file % skip excluded files directory excluded_file diff -r b11c855cde96 -r 6ffca2bf23da tests/test-tags --- a/tests/test-tags Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-tags Fri Nov 09 21:24:25 2007 -0200 @@ -116,13 +116,13 @@ cd t4 echo foo > foo hg add -hg ci -m 'add foo' -d '0 0' # rev 0 -hg tag -d '0 0' bar # rev 1 bar -> 0 -hg tag -d '0 0' -f bar # rev 2 bar -> 1 +hg ci -m 'add foo' # rev 0 +hg tag bar # rev 1 bar -> 0 +hg tag -f bar # rev 2 bar -> 1 hg up -qC 0 -hg tag -d '0 0' -fr 2 bar # rev 3 bar -> 2 +hg tag -fr 2 bar # rev 3 bar -> 2 hg tags hg up -qC 0 -hg tag -d '0 0' -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 +hg tag -m 'retag rev 0' -fr 0 bar # rev 4 bar -> 0, but bar stays at 2 echo % bar should still point to rev 2 hg tags diff -r b11c855cde96 -r 6ffca2bf23da tests/test-trusted.py --- a/tests/test-trusted.py Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-trusted.py Fri Nov 09 21:24:25 2007 -0200 @@ -6,6 +6,9 @@ from mercurial import ui, util hgrc = os.environ['HGRCPATH'] +f = open(hgrc) +basehgrc = f.read() +f.close() def testui(user='foo', group='bar', tusers=(), tgroups=(), cuser='foo', cgroup='bar', debug=False, silent=False): @@ -16,7 +19,8 @@ # write a global hgrc with the list of trusted users/groups and # some setting so that we can be sure it was read f = open(hgrc, 'w') - f.write('[paths]\n') + f.write(basehgrc) + f.write('\n[paths]\n') f.write('global = /some/path\n\n') if tusers or tgroups: diff -r b11c855cde96 -r 6ffca2bf23da tests/test-ui-verbosity --- a/tests/test-ui-verbosity Wed Nov 07 21:13:56 2007 -0600 +++ b/tests/test-ui-verbosity Fri Nov 09 21:24:25 2007 -0200 @@ -4,6 +4,9 @@ from mercurial import ui hgrc = os.environ['HGRCPATH'] +f = open(hgrc) +basehgrc = f.read() +f.close() print ' hgrc settings command line options final result ' print ' quiet verbo debug quiet verbo debug quiet verbo debug' @@ -17,7 +20,8 @@ cmd_debug = bool(i & 1<<5) f = open(hgrc, 'w') - f.write('[ui]\n') + f.write(basehgrc) + f.write('\n[ui]\n') if hgrc_quiet: f.write('quiet = True\n') if hgrc_verbose: