Mercurial > hg-stable
comparison hgext/convert/common.py @ 7075:6db6f6db026a
Merge with crew-stable
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 10 Oct 2008 13:20:40 +0200 |
parents | 0f4564b4cc2c af1117f37fa7 |
children | f77c8d8331ca |
comparison
equal
deleted
inserted
replaced
7072:4e0d54fbd34f | 7075:6db6f6db026a |
---|---|
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 |