Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.9, 0.9.1, and 0.9.1.1

stable thgconfig: try other filenames in rcpath when creating a config file

In some corporate environments, %USERPROFILE% may not be writeable but perhaps
%HOME% is.

Fixes #610

Changeset 1113418ed4f2

Parent 778b2ea72507

by Steve Borho

Changes to one file · Browse files at 1113418ed4f2 Showing diff from parent 778b2ea72507 Diff from another changeset...

 
1054
1055
1056
1057
1058
1059
1060
 
 
 
 
 
 
 
 
 
1061
1062
1063
 
1054
1055
1056
 
 
 
 
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
@@ -1054,10 +1054,15 @@
  if os.path.exists(fn):   break   else: - fn = rcpath[0] - f = open(fn, 'w') - f.write(_('# Generated by tortoisehg-config\n')) - f.close() + for fn in rcpath: + # Try to create a file from rcpath + try: + f = open(fn, 'w') + f.write(_('# Generated by tortoisehg-config\n')) + f.close() + break + except (IOError, OSError): + pass   self.fn = fn   try:   import iniparse