Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

merge with stable

Changeset ebaeb63a444a

Parents 60017f91de5b

Parents 944b5a53b1e3

by Steve Borho

Changes to 3 files · Browse files at ebaeb63a444a Showing diff from parent 60017f91de5b 944b5a53b1e3 Diff from another changeset...

Change 1 of 4 Show Entire File hggtk/​gdialog.py Stacked
 
11
12
13
 
14
15
16
 
181
182
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
185
186
187
188
189
190
 
191
192
193
 
198
199
200
201
 
202
203
204
205
 
 
206
207
208
 
354
355
356
357
 
358
359
360
 
11
12
13
14
15
16
17
 
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
 
210
211
212
213
 
218
219
220
 
221
222
223
 
 
224
225
226
227
228
 
374
375
376
 
377
378
379
380
@@ -11,6 +11,7 @@
 import gtk  import gobject  import pango +import shlex    import os  import threading @@ -181,13 +182,32 @@
  def test_opt(self, opt):   return opt in self.opts and self.opts[opt]   + def _parse_extdiff_cmd(self, usercmd): + for cmd, path in self.ui.configitems('extdiff'): + if cmd.startswith('cmd.'): + cmd = cmd[4:] + if cmd != usercmd: + continue + if not path: + path = cmd + diffopts = self.ui.config('extdiff', 'opts.' + cmd, '') + diffopts = diffopts and [diffopts] or [] + elif cmd == usercmd: + # command = path opts + if path: + diffopts = shlex.split(path) + path = diffopts.pop(0) + else: + path, diffopts = cmd, [] + return path, diffopts + return None, None     def _parse_config(self):   # defaults   self.fontcomment = 'monospace 10'   self.fontdiff = 'monospace 10'   self.fontlist = 'monospace 9' - self.diffopts = '' + self.diffopts = []   self.diffcmd = ''   self.diffbottom = ''   @@ -198,11 +218,11 @@
  # default to tortoisehg's configuration   vdiff = self.ui.config('tortoisehg', 'vdiff', 'vdiff')   if vdiff: - self.diffcmd = self.ui.config('extdiff', 'cmd.'+vdiff) or vdiff + self.diffcmd, self.diffopts = self._parse_extdiff_cmd(vdiff)   else:   self.diffcmd = 'diff' - if not self.diffopts : - self.diffopts = '-Npru' + if not self.diffopts: + self.diffopts = ['-Npru']     if not self.diffbottom:   self.diffbottom = False @@ -354,7 +374,7 @@
    def _diff_file(self, stat, file):   def dodiff(): - extdiff.dodiff(self.ui, self.repo, self.diffcmd, [self.diffopts], + extdiff.dodiff(self.ui, self.repo, self.diffcmd, self.diffopts,   [self.repo.wjoin(file)], self.opts)     if self.diffcmd == 'diff':
 
136
137
138
139
140
141
142
 
 
 
 
 
 
 
143
144
145
 
136
137
138
 
 
 
 
139
140
141
142
143
144
145
146
147
148
@@ -136,10 +136,13 @@
  histlist.append(cs)   cs = {}   else: - name, value = re.split(':\s+', x, 1) - if name not in cs: - cs[name] = [] - cs[name].append(hglib.toutf(value)) + try: + name, value = re.split(':\s+', x, 1) + if name not in cs: + cs[name] = [] + cs[name].append(hglib.toutf(value)) + except ValueError: + pass   if cs:   histlist.append(cs)  
Change 1 of 4 Show Entire File hggtk/​shlib.py Stacked
 
8
9
10
11
12
13
14
 
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
 
116
117
118
119
 
 
 
 
 
120
121
122
 
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
 
159
160
161
 
8
9
10
 
11
12
13
 
87
88
89
 
 
 
 
 
 
 
 
 
 
 
90
91
 
92
93
94
 
103
104
105
 
106
107
108
109
110
111
112
113
 
119
120
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
123
124
125
@@ -8,7 +8,6 @@
 """    import dumbdbm, anydbm -saved_default = anydbm._defaultmod  anydbm._defaultmod = dumbdbm    import os @@ -88,20 +87,8 @@
    def read(self):   self._data.clear() - if os.path.exists(self._path): - # One-time import of <=0.7 config file - anydbm._defaultmod = saved_default - dbase = shelve.open(self._path) - self._dbappname = dbase['APPNAME'] - self.version = dbase['VERSION'] - self._data.update(dbase.get('DATA', {})) - dbase.close() - anydbm._defaultmod = dumbdbm - os.unlink(self._path) - return   if not os.path.exists(self._path+'.dat'):   return -   dbase = shelve.open(self._path)   self._dbappname = dbase['APPNAME']   self.version = dbase['VERSION'] @@ -116,7 +103,11 @@
  dbase['VERSION'] = Settings.version   dbase['APPNAME'] = appname   dbase['DATA'] = data - dbase.close() + try: + dbase.close() + except IOError: + pass # Don't care too much about permission errors +     def _get_path(self, appname):   if os.name == 'nt': @@ -128,34 +119,7 @@
  def _audit(self):   if os.path.exists(os.path.dirname(self._path)):   return - try: - os.makedirs(os.path.dirname(self._path)) - self._import() - except: - pass - - def _import(self): - # import old settings data dir (TortoiseHg <= 0.7) - home = os.path.expanduser('~') - if os.name == 'nt': - olddir = os.path.join(home, '.tortoisehg', 'settings') - newdir = os.path.join(os.environ.get('APPDATA'), 'TortoiseHg') - if os.path.isdir(olddir): - for f in os.listdir(olddir): - src = os.path.join(olddir, f) - dst = os.path.join(newdir, f) - os.rename(src, dst) - os.removedirs(olddir) - - # import old settings data file (TortoiseHg <= 0.3) - oldpath = os.path.join(home, '.hgext', 'tortoisehg') - if os.path.isfile(oldpath): - olddb = shelve.open(oldpath) - for key in olddb.keys(): - self._write(key, olddb[key]) - olddb.close() - os.unlink(oldpath) - os.removedirs(os.path.dirname(oldpath)) + os.makedirs(os.path.dirname(self._path))    def get_system_times():   t = os.times()