##// END OF EJS Templates
merge with stable
Augie Fackler -
r41025:e10adebf merge default
parent child Browse files
Show More
@@ -2330,6 +2330,9 b' class memfilectx(committablefilectx):'
2330 if copied:
2330 if copied:
2331 self._copied = (copied, nullid)
2331 self._copied = (copied, nullid)
2332
2332
2333 def cmp(self, fctx):
2334 return self.data() != fctx.data()
2335
2333 def data(self):
2336 def data(self):
2334 return self._data
2337 return self._data
2335
2338
@@ -267,7 +267,8 b' else:'
267 return self._file.__setattr__(name, value)
267 return self._file.__setattr__(name, value)
268
268
269 def __enter__(self):
269 def __enter__(self):
270 return self._file.__enter__()
270 self._file.__enter__()
271 return self
271
272
272 def __exit__(self, exc_type, exc_value, exc_tb):
273 def __exit__(self, exc_type, exc_value, exc_tb):
273 return self._file.__exit__(exc_type, exc_value, exc_tb)
274 return self._file.__exit__(exc_type, exc_value, exc_tb)
@@ -525,7 +525,8 b' class closewrapbase(object):'
525 return delattr(self._origfh, attr)
525 return delattr(self._origfh, attr)
526
526
527 def __enter__(self):
527 def __enter__(self):
528 return self._origfh.__enter__()
528 self._origfh.__enter__()
529 return self
529
530
530 def __exit__(self, exc_type, exc_value, exc_tb):
531 def __exit__(self, exc_type, exc_value, exc_tb):
531 raise NotImplementedError('attempted instantiating ' + str(type(self)))
532 raise NotImplementedError('attempted instantiating ' + str(type(self)))
@@ -70,7 +70,8 b' class mixedfilemodewrapper(object):'
70 object.__setattr__(self, r'_lastop', 0)
70 object.__setattr__(self, r'_lastop', 0)
71
71
72 def __enter__(self):
72 def __enter__(self):
73 return self._fp.__enter__()
73 self._fp.__enter__()
74 return self
74
75
75 def __exit__(self, exc_type, exc_val, exc_tb):
76 def __exit__(self, exc_type, exc_val, exc_tb):
76 self._fp.__exit__(exc_type, exc_val, exc_tb)
77 self._fp.__exit__(exc_type, exc_val, exc_tb)
@@ -132,7 +133,10 b' class fdproxy(object):'
132 self._fp = fp
133 self._fp = fp
133
134
134 def __enter__(self):
135 def __enter__(self):
135 return self._fp.__enter__()
136 self._fp.__enter__()
137 # Return this wrapper for the context manager so that the name is
138 # still available.
139 return self
136
140
137 def __exit__(self, exc_type, exc_value, traceback):
141 def __exit__(self, exc_type, exc_value, traceback):
138 self._fp.__exit__(exc_type, exc_value, traceback)
142 self._fp.__exit__(exc_type, exc_value, traceback)
@@ -213,11 +213,7 b' def _posixworker(ui, func, staticargs, a'
213 waitforworkers()
213 waitforworkers()
214 signal.signal(signal.SIGCHLD, oldchldhandler)
214 signal.signal(signal.SIGCHLD, oldchldhandler)
215 selector.close()
215 selector.close()
216 status = problem[0]
216 return problem[0]
217 if status:
218 if status < 0:
219 os.kill(os.getpid(), -status)
220 sys.exit(status)
221 try:
217 try:
222 openpipes = len(pipes)
218 openpipes = len(pipes)
223 while openpipes > 0:
219 while openpipes > 0:
@@ -236,7 +232,11 b' def _posixworker(ui, func, staticargs, a'
236 killworkers()
232 killworkers()
237 cleanup()
233 cleanup()
238 raise
234 raise
239 cleanup()
235 status = cleanup()
236 if status:
237 if status < 0:
238 os.kill(os.getpid(), -status)
239 sys.exit(status)
240
240
241 def _posixexitstatus(code):
241 def _posixexitstatus(code):
242 '''convert a posix exit status into the same form returned by
242 '''convert a posix exit status into the same form returned by
@@ -587,6 +587,17 b' def rename(src, dst):'
587 shutil.copy(src, dst)
587 shutil.copy(src, dst)
588 os.remove(src)
588 os.remove(src)
589
589
590 def makecleanable(path):
591 """Try to fix directory permission recursively so that the entire tree
592 can be deleted"""
593 for dirpath, dirnames, _filenames in os.walk(path, topdown=True):
594 for d in dirnames:
595 p = os.path.join(dirpath, d)
596 try:
597 os.chmod(p, os.stat(p).st_mode & 0o777 | 0o700) # chmod u+rwx
598 except OSError:
599 pass
600
590 _unified_diff = difflib.unified_diff
601 _unified_diff = difflib.unified_diff
591 if PYTHON3:
602 if PYTHON3:
592 import functools
603 import functools
@@ -953,7 +964,13 b' class Test(unittest.TestCase):'
953 (self._testtmp.decode('utf-8'),
964 (self._testtmp.decode('utf-8'),
954 self._threadtmp.decode('utf-8')))
965 self._threadtmp.decode('utf-8')))
955 else:
966 else:
956 shutil.rmtree(self._testtmp, True)
967 try:
968 shutil.rmtree(self._testtmp)
969 except OSError:
970 # unreadable directory may be left in $TESTTMP; fix permission
971 # and try again
972 makecleanable(self._testtmp)
973 shutil.rmtree(self._testtmp, True)
957 shutil.rmtree(self._threadtmp, True)
974 shutil.rmtree(self._threadtmp, True)
958
975
959 if self._usechg:
976 if self._usechg:
General Comments 0
You need to be logged in to leave comments. Login now