comparison wrappers.py @ 261:141513b5173b

Stop breaking hg pull <path>.
author Augie Fackler <durin42@gmail.com>
date Sun, 12 Apr 2009 12:18:04 -0500
parents 87dc4d0dd048
children 3b3627611468
comparison
equal deleted inserted replaced
260:87dc4d0dd048 261:141513b5173b
200 raise hgutil.Abort("destination '%s' already exists" % dest) 200 raise hgutil.Abort("destination '%s' already exists" % dest)
201 url = util.normalize_url(svnurl) 201 url = util.normalize_url(svnurl)
202 res = -1 202 res = -1
203 try: 203 try:
204 try: 204 try:
205 res = pull(None, ui, None, True, opts.pop('svn_stupid', False), 205 res = pull(None, ui, None, source=url, svn=None,
206 source=url, create_new_dest=dest, **opts) 206 svn_stupid=opts.pop('svn_stupid', False),
207 create_new_dest=dest, **opts)
207 except core.SubversionException, e: 208 except core.SubversionException, e:
208 if e.apr_err == core.SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED: 209 if e.apr_err == core.SVN_ERR_RA_SERF_SSL_CERT_UNTRUSTED:
209 raise hgutil.Abort('It appears svn does not trust the ssl cert for this site.\n' 210 raise hgutil.Abort('It appears svn does not trust the ssl cert for this site.\n'
210 'Please try running svn ls on that url first.') 211 'Please try running svn ls on that url first.')
211 raise 212 raise
221 commands.update(ui, repo, repo['tip'].node()) 222 commands.update(ui, repo, repo['tip'].node())
222 223
223 return res 224 return res
224 225
225 226
226 def pull(orig, ui, repo, svn=None, svn_stupid=False, source="default", create_new_dest=False, 227 def pull(orig, ui, repo, source="default", *args, **opts):
227 *args, **opts):
228 """pull new revisions from Subversion 228 """pull new revisions from Subversion
229 """ 229
230 Also takes svn, svn_stupid, and create_new_dest kwargs.
231 """
232 svn = opts.pop('svn', None)
233 svn_stupid = opts.pop('svn_stupid', False)
234 create_new_dest = opts.pop('create_new_dest', False)
230 url = ((repo and repo.ui) or ui).expandpath(source) 235 url = ((repo and repo.ui) or ui).expandpath(source)
231 if not (cmdutil.issvnurl(url) or svn or create_new_dest): 236 if not (cmdutil.issvnurl(url) or svn or create_new_dest):
232 return orig(ui, repo, source=source, *args, **opts) 237 return orig(ui, repo, source=source, *args, **opts)
233 svn_url = url 238 svn_url = url
234 svn_url = util.normalize_url(svn_url) 239 svn_url = util.normalize_url(svn_url)