Anonymous avatar Anonymous committed 102a8ca

fixed usage of iniparse

apparently iniparse is a different version when you easy_install it
vs. when it comes with tortoisehg

Comments (0)

Files changed (2)

                 return
         else:
             if section not in list(ini):
-                ini.new_namespace(section)
+                # ini.new_namespace(section) (doesn't work outside tortoisehg)
+                raise util.Abort(_('section unavailable: %s') % (section))
             ini[section][name] = value
 
     def saverc(self):
             f = open(fn, "w")
             #apparently there is a bug in iniparse
             #it doesn't like an empty file
-            f.write('\n')
+            f.write('\n[paths]\n\n[ui]\n')
             f.close()
             addline = True
         ini = iniparse.INIConfig(file(fn))

tests/test-bind.out

 ### call hg bind default
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 
 [ui]
 bound = True
+
 ### echo fdsa > fdsa.txt
 ### call hg add
 adding fdsa.txt
 ### call hg unbind
 ### type .hg\boundrc
 
+[paths]
+auto-push = default
 
+[ui]
+bound = False
+
+### call hg bind
+### type .hg\boundrc
+
+[paths]
+auto-push = default
+
+[ui]
+bound = True
+
+### call hg bind
+abort: repository is already bound
+### type .hg\boundrc
+
+[paths]
+auto-push = default
+
+[ui]
+bound = True
+
+### call hg unbind
+### type .hg\boundrc
 
 [paths]
 auto-push = default
 
 [ui]
 bound = False
-### call hg bind
-### type .hg\boundrc
 
-
-
-[paths]
-auto-push = default
-
-[ui]
-bound = True
-### call hg bind
-abort: repository is already bound
-### type .hg\boundrc
-
-
-
-[paths]
-auto-push = default
-
-[ui]
-bound = True
-### call hg unbind
-### type .hg\boundrc
-
-
-
-[paths]
-auto-push = default
-
-[ui]
-bound = False
 ### call hg bind default
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 bound-push = default
 
 [ui]
 bound = True
+
 ### call hg unbind
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 
 [ui]
 bound = False
+
 ### call hg bind
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 
 [ui]
 bound = True
+
 ### call hg unbind
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 
 [ui]
 bound = False
+
 ### call hg bind -a "..\master"
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = ..\master
 
 [ui]
 bound = True
+
 ### call hg bind -f "default"
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = ..\master
 bound-push = default
 
 [ui]
 bound = True
+
 ### call hg bind -a -f "default"
 ### type .hg\boundrc
 
-
-
 [paths]
 auto-push = default
 
 [ui]
 bound = True
+
 ### copy .hg\boundrc .hgboundrc
         1 file(s) copied.
 ### call hg add
 ### call hg unbind
 ### type .hg\boundrc
 
-
+[paths]
 
 [ui]
 bound = False
+
 ### call hg bind
 ### type .hg\boundrc
 
-
+[paths]
 
 [ui]
 bound = True
+
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.