Issue #91 resolved

EOL problem with settings dialog

Johan Samyn
created an issue

Making a change in a config file with the settings dialog adds extra 0D and 0A characters at the end of each line.

Comments (4)

  1. Johan Samyn reporter

    I corrected the files, so only 0D0A is at the and of lines, and changed something in the settings dialog again. This yielded the following traceback:

    ** Please report this bug to http://bitbucket.org/tortoisehg/thg/issues
    ** Mercurial version (1.7.1).  TortoiseHg version (1.9.1+174-171a31ad13aa)
    ** Command: log
    ** CWD: M:\DEV\thg-qt
    ** Extensions loaded: patchbomb, cifiles, extdiff, graphlog, mq, rebase
    ** Python version: 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]
    ** Windows version: (6, 1, 7600, 2, '')
    ** Processor architecture: x86
    Traceback (most recent call last):
      File "M:\DEV\thg-qt\tortoisehg\hgqt\settings.py", line 667, in accept
        self.applyChanges()
      File "M:\DEV\thg-qt\tortoisehg\hgqt\settings.py", line 645, in applyChanges
        self.conftabs.widget(i).applyChanges()
      File "M:\DEV\thg-qt\tortoisehg\hgqt\settings.py", line 951, in applyChanges
        wconfig.writefile(self.ini, self.fn)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 238, in writefile
        config.write(f)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 170, in write
        ini = self._readini()
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 198, in _readini
        return newini(fp)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 181, in newini
        return INIConfig(fp=fp, optionxformvalue=None)
      File "C:\python26\lib\site-packages\iniparse\ini.py", line 472, in __init__
        self._readfp(fp)
      File "C:\python26\lib\site-packages\iniparse\ini.py", line 642, in _readfp
        raise exc
    ParsingError: File contains parsing errors: C:\Users\Johan\mercurial.ini
    	[line 41]: [web]style = monobluestripes = 1cacerts = C:\Programs\TortoiseHg\hgrc.d\cacert.pem
    
    	[line 42]: [email]from = Johan Samyn <johan.samyn@gmail.com>to = johan_samyn@yahoo.co.ukmethod = smtp
    
    	[line 43]: [smtp]host = smtp.gmail.comport = 587tls = Trueusername = johan.samyn@gmail.com
    
    	[line 44]: [diff]git = True
    
    	[line 45]: [extensions]patchbomb =#purge =#bookmarks =cifiles = C:\Programs\hgext\cifiles.py#collapse = M:\DEV\hgcollapse\hgext\collapse.pycolor =
    
    	[line 51]: [defaults]status = -Cqqdelete = --keep# tip from sborho, to keep the commit date in a (mq) patch up-to-date#qrefresh = -D
    
    	[line 53]: [progress]delay = 3refresh = 0.1# format: topic number unit itemformat = barclear-complete = True#disable = False
    
    	[line 54]: [extdiff]cmd.oodiff = oodiffopts.oodiff = -u#diff-ext %base %mine#merge-ext %merged %theirs %mine %base
    
    	[line 57]: [bookmarks]track.current = True
    

    And added extra EOL characters again.

  2. Johan Samyn reporter

    Freshly starting the Workbench with tip, starting the Settings dialog, making a change in the repo hgrc file, clicking on the 'Edit file' button, confirming 'save', yields the following traceback :

    ** Please report this bug to http://bitbucket.org/tortoisehg/thg/issues
    ** Mercurial version (1.7.1).  TortoiseHg version (1.9.1+174-171a31ad13aa)
    ** Command: log
    ** CWD: M:\DEV\thg-qt
    ** Extensions loaded: patchbomb, cifiles, extdiff, graphlog, mq, rebase
    ** Python version: 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)]
    ** Windows version: (6, 1, 7600, 2, '')
    ** Processor architecture: x86
    Traceback (most recent call last):
      File "M:\DEV\thg-qt\tortoisehg\hgqt\settings.py", line 759, in editClicked
        self.applyChanges()
      File "M:\DEV\thg-qt\tortoisehg\hgqt\settings.py", line 951, in applyChanges
        wconfig.writefile(self.ini, self.fn)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 238, in writefile
        config.write(f)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 170, in write
        ini = self._readini()
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 198, in _readini
        return newini(fp)
      File "M:\DEV\thg-qt\tortoisehg\util\wconfig.py", line 181, in newini
        return INIConfig(fp=fp, optionxformvalue=None)
      File "C:\python26\lib\site-packages\iniparse\ini.py", line 472, in __init__
        self._readfp(fp)
      File "C:\python26\lib\site-packages\iniparse\ini.py", line 566, in _readfp
        raise MissingSectionHeaderError(fname, linecount, line)
    MissingSectionHeaderError: File contains no section headers.
    file: C:\DEV\thg-qt-work\.hg\hgrc, line: 1
    '[paths]\rdefault = M:\\DEV\\thg-qt\r\r\n'
    
  3. Log in to comment