Show More
@@ -585,11 +585,13 b' class cookietransportrequest(object):' | |||||
585 | # inheritance with a new-style class. |
|
585 | # inheritance with a new-style class. | |
586 | class cookietransport(cookietransportrequest, xmlrpclib.Transport): |
|
586 | class cookietransport(cookietransportrequest, xmlrpclib.Transport): | |
587 | def __init__(self, use_datetime=0): |
|
587 | def __init__(self, use_datetime=0): | |
588 |
xmlrpclib.Transport |
|
588 | if util.safehasattr(xmlrpclib.Transport, "__init__"): | |
|
589 | xmlrpclib.Transport.__init__(self, use_datetime) | |||
589 |
|
590 | |||
590 | class cookiesafetransport(cookietransportrequest, xmlrpclib.SafeTransport): |
|
591 | class cookiesafetransport(cookietransportrequest, xmlrpclib.SafeTransport): | |
591 | def __init__(self, use_datetime=0): |
|
592 | def __init__(self, use_datetime=0): | |
592 | xmlrpclib.SafeTransport.__init__(self, use_datetime) |
|
593 | if util.safehasattr(xmlrpclib.Transport, "__init__"): | |
|
594 | xmlrpclib.SafeTransport.__init__(self, use_datetime) | |||
593 |
|
595 | |||
594 | class bzxmlrpc(bzaccess): |
|
596 | class bzxmlrpc(bzaccess): | |
595 | """Support for access to Bugzilla via the Bugzilla XMLRPC API. |
|
597 | """Support for access to Bugzilla via the Bugzilla XMLRPC API. |
@@ -85,10 +85,8 b' def uisetup(ui):' | |||||
85 | (cmd not in ui.configlist('pager', 'ignore') and not attend))): |
|
85 | (cmd not in ui.configlist('pager', 'ignore') and not attend))): | |
86 | ui.setconfig('ui', 'formatted', ui.formatted()) |
|
86 | ui.setconfig('ui', 'formatted', ui.formatted()) | |
87 | ui.setconfig('ui', 'interactive', False) |
|
87 | ui.setconfig('ui', 'interactive', False) | |
88 | try: |
|
88 | if util.safehasattr(signal, "SIGPIPE"): | |
89 | signal.signal(signal.SIGPIPE, signal.SIG_DFL) |
|
89 | signal.signal(signal.SIGPIPE, signal.SIG_DFL) | |
90 | except ValueError: |
|
|||
91 | pass |
|
|||
92 | _runpager(p) |
|
90 | _runpager(p) | |
93 | return orig(ui, options, cmd, cmdfunc) |
|
91 | return orig(ui, options, cmd, cmdfunc) | |
94 |
|
92 |
@@ -135,7 +135,7 b' testhunk(PyObject *self, PyObject *args)' | |||||
135 | return NULL; |
|
135 | return NULL; | |
136 | alen = PyList_Size(a); |
|
136 | alen = PyList_Size(a); | |
137 | blen = PyList_Size(b); |
|
137 | blen = PyList_Size(b); | |
138 | if (alen > blen - bstart) { |
|
138 | if (alen > blen - bstart || bstart < 0) { | |
139 | return Py_BuildValue("l", -1); |
|
139 | return Py_BuildValue("l", -1); | |
140 | } |
|
140 | } | |
141 | for (i = 0; i < alen; i++) { |
|
141 | for (i = 0; i < alen; i++) { |
@@ -1014,9 +1014,9 b' class hunk(object):' | |||||
1014 | oldstart = self.starta + top |
|
1014 | oldstart = self.starta + top | |
1015 | newstart = self.startb + top |
|
1015 | newstart = self.startb + top | |
1016 | # zero length hunk ranges already have their start decremented |
|
1016 | # zero length hunk ranges already have their start decremented | |
1017 | if self.lena: |
|
1017 | if self.lena and oldstart > 0: | |
1018 | oldstart -= 1 |
|
1018 | oldstart -= 1 | |
1019 | if self.lenb: |
|
1019 | if self.lenb and newstart > 0: | |
1020 | newstart -= 1 |
|
1020 | newstart -= 1 | |
1021 | return old, oldstart, new, newstart |
|
1021 | return old, oldstart, new, newstart | |
1022 |
|
1022 |
@@ -997,6 +997,26 b' import a unified diff with no lines of c' | |||||
997 | c3 |
|
997 | c3 | |
998 | c4 |
|
998 | c4 | |
999 |
|
999 | |||
|
1000 | no segfault while importing a unified diff which start line is zero but chunk | |||
|
1001 | size is non-zero | |||
|
1002 | ||||
|
1003 | $ hg init startlinezero | |||
|
1004 | $ cd startlinezero | |||
|
1005 | $ echo foo > foo | |||
|
1006 | $ hg commit -Amfoo | |||
|
1007 | adding foo | |||
|
1008 | ||||
|
1009 | $ hg import --no-commit - << EOF | |||
|
1010 | > diff a/foo b/foo | |||
|
1011 | > --- a/foo | |||
|
1012 | > +++ b/foo | |||
|
1013 | > @@ -0,1 +0,1 @@ | |||
|
1014 | > foo | |||
|
1015 | > EOF | |||
|
1016 | applying patch from stdin | |||
|
1017 | ||||
|
1018 | $ cd .. | |||
|
1019 | ||||
1000 | Test corner case involving fuzz and skew |
|
1020 | Test corner case involving fuzz and skew | |
1001 |
|
1021 | |||
1002 | $ hg init morecornercases |
|
1022 | $ hg init morecornercases |
General Comments 0
You need to be logged in to leave comments.
Login now