equal
deleted
inserted
replaced
1 # common code for the convert extension |
1 # common code for the convert extension |
2 import base64, errno |
2 import base64, errno |
3 import os |
3 import os |
4 import cPickle as pickle |
4 import cPickle as pickle |
5 from mercurial import util |
5 from mercurial import util, strutil |
6 from mercurial.i18n import _ |
6 from mercurial.i18n import _ |
7 |
7 |
8 def encodeargs(args): |
8 def encodeargs(args): |
9 def encodearg(s): |
9 def encodearg(s): |
10 lines = base64.encodestring(s) |
10 lines = base64.encodestring(s) |
330 except IOError, err: |
330 except IOError, err: |
331 if err.errno != errno.ENOENT: |
331 if err.errno != errno.ENOENT: |
332 raise |
332 raise |
333 return |
333 return |
334 for line in fp: |
334 for line in fp: |
335 key, value = line[:-1].split(' ', 1) |
335 key, value = strutil.rsplit(line[:-1], ' ', 1) |
336 if key not in self: |
336 if key not in self: |
337 self.order.append(key) |
337 self.order.append(key) |
338 super(mapfile, self).__setitem__(key, value) |
338 super(mapfile, self).__setitem__(key, value) |
339 fp.close() |
339 fp.close() |
340 |
340 |