comparison contrib/synthrepo.py @ 17887:0e2846b2482c stable

url: use open and not url.open for local files (issue3624)
author Siddharth Agarwal <sid0@fb.com>
date Wed, 17 Oct 2012 21:30:08 -0700
parents 619068c280fd
children 9196638b08ce
comparison
equal deleted inserted replaced
17886:d8905e2c1301 17887:0e2846b2482c
34 - Executability of files 34 - Executability of files
35 - Symlinks and binary files are ignored 35 - Symlinks and binary files are ignored
36 ''' 36 '''
37 37
38 import bisect, collections, json, os, random, time 38 import bisect, collections, json, os, random, time
39 from mercurial import cmdutil, context, patch, scmutil, url, util 39 from mercurial import cmdutil, context, patch, scmutil, url, util, hg
40 from mercurial.i18n import _ 40 from mercurial.i18n import _
41 from mercurial.node import nullrev, nullid 41 from mercurial.node import nullrev, nullid
42 42
43 testedwith = 'internal' 43 testedwith = 'internal'
44 44
222 names, words will be chosen randomly from a dictionary that is 222 names, words will be chosen randomly from a dictionary that is
223 presumed to contain one word per line. Use --dict to specify the 223 presumed to contain one word per line. Use --dict to specify the
224 path to an alternate dictionary to use. 224 path to an alternate dictionary to use.
225 ''' 225 '''
226 try: 226 try:
227 fp = url.open(ui, descpath) 227 fp = hg.openpath(ui, descpath)
228 except Exception, err: 228 except Exception, err:
229 raise util.Abort('%s: %s' % (descpath, err[0].strerror)) 229 raise util.Abort('%s: %s' % (descpath, err[0].strerror))
230 desc = json.load(fp) 230 desc = json.load(fp)
231 fp.close() 231 fp.close()
232 232