Show More
@@ -3496,7 +3496,7 b' def import_(ui, repo, patch1=None, *patc' | |||||
3496 | else: |
|
3496 | else: | |
3497 | patchurl = os.path.join(base, patchurl) |
|
3497 | patchurl = os.path.join(base, patchurl) | |
3498 | ui.status(_('applying %s\n') % patchurl) |
|
3498 | ui.status(_('applying %s\n') % patchurl) | |
3499 | patchfile = hg.openpath(ui, patchurl) |
|
3499 | patchfile = hg.openpath(ui, patchurl, sendaccept=False) | |
3500 |
|
3500 | |||
3501 | haspatch = False |
|
3501 | haspatch = False | |
3502 | for hunk in patch.split(patchfile): |
|
3502 | for hunk in patch.split(patchfile): |
@@ -153,13 +153,13 b' def islocal(repo):' | |||||
153 | return False |
|
153 | return False | |
154 | return repo.local() |
|
154 | return repo.local() | |
155 |
|
155 | |||
156 | def openpath(ui, path): |
|
156 | def openpath(ui, path, sendaccept=True): | |
157 | '''open path with open if local, url.open if remote''' |
|
157 | '''open path with open if local, url.open if remote''' | |
158 | pathurl = util.url(path, parsequery=False, parsefragment=False) |
|
158 | pathurl = util.url(path, parsequery=False, parsefragment=False) | |
159 | if pathurl.islocal(): |
|
159 | if pathurl.islocal(): | |
160 | return util.posixfile(pathurl.localpath(), 'rb') |
|
160 | return util.posixfile(pathurl.localpath(), 'rb') | |
161 | else: |
|
161 | else: | |
162 | return url.open(ui, path) |
|
162 | return url.open(ui, path, sendaccept=sendaccept) | |
163 |
|
163 | |||
164 | # a list of (ui, repo) functions called for wire peer initialization |
|
164 | # a list of (ui, repo) functions called for wire peer initialization | |
165 | wirepeersetupfuncs = [] |
|
165 | wirepeersetupfuncs = [] |
@@ -601,7 +601,7 b' def opener(ui, authinfo=None, useragent=' | |||||
601 |
|
601 | |||
602 | return opener |
|
602 | return opener | |
603 |
|
603 | |||
604 | def open(ui, url_, data=None): |
|
604 | def open(ui, url_, data=None, sendaccept=True): | |
605 | u = util.url(url_) |
|
605 | u = util.url(url_) | |
606 | if u.scheme: |
|
606 | if u.scheme: | |
607 | u.scheme = u.scheme.lower() |
|
607 | u.scheme = u.scheme.lower() | |
@@ -610,7 +610,9 b' def open(ui, url_, data=None):' | |||||
610 | path = util.normpath(os.path.abspath(url_)) |
|
610 | path = util.normpath(os.path.abspath(url_)) | |
611 | url_ = 'file://' + pycompat.bytesurl(urlreq.pathname2url(path)) |
|
611 | url_ = 'file://' + pycompat.bytesurl(urlreq.pathname2url(path)) | |
612 | authinfo = None |
|
612 | authinfo = None | |
613 |
return opener(ui, authinfo |
|
613 | return opener(ui, authinfo, | |
|
614 | sendaccept=sendaccept).open(pycompat.strurl(url_), | |||
|
615 | data) | |||
614 |
|
616 | |||
615 | def wrapresponse(resp): |
|
617 | def wrapresponse(resp): | |
616 | """Wrap a response object with common error handlers. |
|
618 | """Wrap a response object with common error handlers. |
General Comments 0
You need to be logged in to leave comments.
Login now