##// END OF EJS Templates
merge with stable
Yuya Nishihara -
r45068:f8427841 merge default
parent child Browse files
Show More
@@ -328,6 +328,7 b' def main():'
328 328 'allow-attr-methods': args.allow_attr_methods,
329 329 }
330 330 for fname in args.files:
331 fname = os.path.realpath(fname)
331 332 if args.inplace:
332 333 with editinplace(fname) as fout:
333 334 with open(fname, 'rb') as fin:
@@ -6,7 +6,7 b' before_script:'
6 6 - hg clone . /tmp/mercurial-ci/ --noupdate
7 7 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
8 8 - cd /tmp/mercurial-ci/
9 - (cd tests; ls -1 test-check-*.*) > /tmp/check-tests.txt
9 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
10 10
11 11 variables:
12 12 PYTHON: python
@@ -14,10 +14,9 b' variables:'
14 14
15 15 .runtests_template: &runtests
16 16 script:
17 - cd tests/
18 17 - echo "python used, $PYTHON"
19 18 - echo "$RUNTEST_ARGS"
20 - HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" run-tests.py --color=always $RUNTEST_ARGS
19 - HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS
21 20
22 21 checks-py2:
23 22 <<: *runtests
@@ -135,34 +135,38 b' class tarit(object):'
135 135 '''write archive to tar file or stream. can write uncompressed,
136 136 or compress with gzip or bzip2.'''
137 137
138 class GzipFileWithTime(gzip.GzipFile):
139 def __init__(self, *args, **kw):
140 timestamp = None
141 if 'timestamp' in kw:
142 timestamp = kw.pop('timestamp')
143 if timestamp is None:
144 self.timestamp = time.time()
145 else:
146 self.timestamp = timestamp
147 gzip.GzipFile.__init__(self, *args, **kw)
138 if pycompat.ispy3:
139 GzipFileWithTime = gzip.GzipFile # camelcase-required
140 else:
141
142 class GzipFileWithTime(gzip.GzipFile):
143 def __init__(self, *args, **kw):
144 timestamp = None
145 if 'mtime' in kw:
146 timestamp = kw.pop('mtime')
147 if timestamp is None:
148 self.timestamp = time.time()
149 else:
150 self.timestamp = timestamp
151 gzip.GzipFile.__init__(self, *args, **kw)
148 152
149 def _write_gzip_header(self):
150 self.fileobj.write(b'\037\213') # magic header
151 self.fileobj.write(b'\010') # compression method
152 fname = self.name
153 if fname and fname.endswith(b'.gz'):
154 fname = fname[:-3]
155 flags = 0
156 if fname:
157 flags = gzip.FNAME # pytype: disable=module-attr
158 self.fileobj.write(pycompat.bytechr(flags))
159 gzip.write32u( # pytype: disable=module-attr
160 self.fileobj, int(self.timestamp)
161 )
162 self.fileobj.write(b'\002')
163 self.fileobj.write(b'\377')
164 if fname:
165 self.fileobj.write(fname + b'\000')
153 def _write_gzip_header(self):
154 self.fileobj.write(b'\037\213') # magic header
155 self.fileobj.write(b'\010') # compression method
156 fname = self.name
157 if fname and fname.endswith(b'.gz'):
158 fname = fname[:-3]
159 flags = 0
160 if fname:
161 flags = gzip.FNAME # pytype: disable=module-attr
162 self.fileobj.write(pycompat.bytechr(flags))
163 gzip.write32u( # pytype: disable=module-attr
164 self.fileobj, int(self.timestamp)
165 )
166 self.fileobj.write(b'\002')
167 self.fileobj.write(b'\377')
168 if fname:
169 self.fileobj.write(fname + b'\000')
166 170
167 171 def __init__(self, dest, mtime, kind=b''):
168 172 self.mtime = mtime
@@ -178,7 +182,7 b' class tarit(object):'
178 182 pycompat.sysstr(mode + b'b'),
179 183 zlib.Z_BEST_COMPRESSION,
180 184 fileobj,
181 timestamp=mtime,
185 mtime=mtime,
182 186 )
183 187 self.fileobj = gzfileobj
184 188 return tarfile.TarFile.taropen( # pytype: disable=attribute-error
@@ -159,7 +159,10 b' static const char *index_deref(indexObje'
159 159 sizeof(*self->offsets));
160 160 if (self->offsets == NULL)
161 161 return (const char *)PyErr_NoMemory();
162 inline_scan(self, self->offsets);
162 Py_ssize_t ret = inline_scan(self, self->offsets);
163 if (ret == -1) {
164 return NULL;
165 };
163 166 }
164 167 return self->offsets[pos];
165 168 }
@@ -27,6 +27,14 b' pub use revlog::*;'
27 27 pub mod re2;
28 28 pub mod utils;
29 29
30 // Remove this to see (potential) non-artificial compile failures. MacOS
31 // *should* compile, but fail to compile tests for example as of 2020-03-06
32 #[cfg(not(target_os = "linux"))]
33 compile_error!(
34 "`hg-core` has only been tested on Linux and will most \
35 likely not behave correctly on other platforms."
36 );
37
30 38 use crate::utils::hg_path::{HgPathBuf, HgPathError};
31 39 pub use filepatterns::{
32 40 parse_pattern_syntax, read_pattern_file, IgnorePattern,
@@ -1632,7 +1632,7 b' class TTest(Test):'
1632 1632 return self._have.get(allreqs)
1633 1633
1634 1634 # TODO do something smarter when all other uses of hghave are gone.
1635 runtestdir = os.path.abspath(os.path.dirname(_sys2bytes(__file__)))
1635 runtestdir = osenvironb[b'RUNTESTDIR']
1636 1636 tdir = runtestdir.replace(b'\\', b'/')
1637 1637 proc = Popen4(
1638 1638 b'%s -c "%s/hghave %s"' % (self._shell, tdir, allreqs),
General Comments 0
You need to be logged in to leave comments. Login now