Fri, 13 Mar 2015 20:34:52 -0400 filectx: add a repo accessor
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Mar 2015 20:34:52 -0400] rev 24333
filectx: add a repo accessor This is similar to a07314472a80 in motivation. All contexts now have this method, so the rest of the 'ctx._repo' uses can be converted without worrying about what type of context it is.
Fri, 13 Mar 2015 13:03:55 -0400 run-tests: ignore ENOENT failures when removing old .err results
Augie Fackler <augie@google.com> [Fri, 13 Mar 2015 13:03:55 -0400] rev 24332
run-tests: ignore ENOENT failures when removing old .err results When the same test runs in multiple threads and the previous run was a failure, the threads can race to delete the error output. This fixes that.
Fri, 13 Mar 2015 12:50:53 -0400 run-tests: stop storing start/stop times in a dict by test name
Augie Fackler <augie@google.com> [Fri, 13 Mar 2015 12:50:53 -0400] rev 24331
run-tests: stop storing start/stop times in a dict by test name This resolves the last breakage in run-tests that prevented me from running a single test many times in several threads in parallel. This will be useful for testing potential fixes to flaky tests.
Fri, 13 Mar 2015 12:47:16 -0400 run-tests: avoid running the same test instance concurrently
Augie Fackler <augie@google.com> [Fri, 13 Mar 2015 12:47:16 -0400] rev 24330
run-tests: avoid running the same test instance concurrently There's a fair amount of mutable state stored on test case instances. That causes many weird failures if you try to do something like `run-tests.py -j16 --loop test-help.t`. The quick fix is this slightly weird test-reloading dance, which ensures that every time a test is executed it runs on a fresh instance of the TestCase subclass.
Fri, 13 Mar 2015 11:21:53 -0400 run-tests: add --runs-per-test flag
Augie Fackler <augie@google.com> [Fri, 13 Mar 2015 11:21:53 -0400] rev 24329
run-tests: add --runs-per-test flag This is useful when you're working with a flaky test and want to run it (for example) 500 times to see if it'll false-fail. This currently breaks if you use it with more than one thread, but I'm looking into that now.
Thu, 12 Mar 2015 21:41:50 -0400 convert: adjust progress bar for octopus merges (issue4169)
Augie Fackler <augie@google.com> [Thu, 12 Mar 2015 21:41:50 -0400] rev 24328
convert: adjust progress bar for octopus merges (issue4169) For merges, we walk the files N-1 times, where N is the number of parents. This means that for an octopus merge with 3 parents and 2 changed files, we actually fetch 6 files. This corrects the progress output of the convert command when such commits are encountered.
Thu, 12 Mar 2015 21:31:52 -0400 test-convert-git: show insane progress bar with octopus merge (issue4169)
Augie Fackler <augie@google.com> [Thu, 12 Mar 2015 21:31:52 -0400] rev 24327
test-convert-git: show insane progress bar with octopus merge (issue4169) This is done as a separate change from the fix so that it's obvious what is corrected by the bugfix.
Fri, 13 Mar 2015 15:36:11 -0700 manifest: have context use self.hasdir()
Drew Gottlieb <drgott@google.com> [Fri, 13 Mar 2015 15:36:11 -0700] rev 24326
manifest: have context use self.hasdir() A couple places in context currently use "x in self._dirs" to check for the existence of the directory, but this requires that all directories be loaded into a dict. Calling hasdir() instead puts the work on the the manifest to check for the existence of a directory in the most efficient manner.
Fri, 13 Mar 2015 15:32:45 -0700 manifest: add hasdir() to context
Drew Gottlieb <drgott@google.com> [Fri, 13 Mar 2015 15:32:45 -0700] rev 24325
manifest: add hasdir() to context This is a convenience method that calls to its manifest's hasdir(). There are parts of context that check to see if a directory exists, and this method will let implementations of manifest provide an optimal way to find a particular directory.
Fri, 13 Mar 2015 15:25:01 -0700 manifest: add manifestdict.hasdir() method
Drew Gottlieb <drgott@google.com> [Fri, 13 Mar 2015 15:25:01 -0700] rev 24324
manifest: add manifestdict.hasdir() method Allows for alternative implementations of manifestdict to decide if a directory exists in whatever way is most optimal.
Fri, 13 Mar 2015 15:23:02 -0700 manifest: have context's dirs() call its manifest's dirs()
Drew Gottlieb <drgott@google.com> [Fri, 13 Mar 2015 15:23:02 -0700] rev 24323
manifest: have context's dirs() call its manifest's dirs() This lets the context's dirs() method be agnostic towards any alternate manifest implementations.
Fri, 13 Mar 2015 15:19:54 -0700 manifest: add dirs() to manifestdict
Drew Gottlieb <drgott@google.com> [Fri, 13 Mar 2015 15:19:54 -0700] rev 24322
manifest: add dirs() to manifestdict Manifests should have a method of accessing its own dirs, not just the context that references the manifest. This makes it easier for other optimized versions of manifests to compute their own dirs in the most efficient way.
Wed, 17 Sep 2014 22:34:34 +0900 formatter: convert None to json null
Yuya Nishihara <yuya@tcha.org> [Wed, 17 Sep 2014 22:34:34 +0900] rev 24321
formatter: convert None to json null It will be used by "annotate" command to represent the workingctx revision.
Sun, 17 Aug 2014 11:35:31 +0900 localrepo: extend "changeid in repo" to return True for workingctx revision
Yuya Nishihara <yuya@tcha.org> [Sun, 17 Aug 2014 11:35:31 +0900] rev 24320
localrepo: extend "changeid in repo" to return True for workingctx revision This is necessary to implement "wc" symbol for workingctx, that will be used as follows: $ hg annotate -r wc FILE In principle, "rev in repo" should be True if "repo[rev]" can return a context object. But when it was implemented by ea3acaae25bb, lookup() had a long logic to map all sorts of changeids to nodes, and "None in repo" did crash because lookup() could not accept None. So I assume that the case of changeid=None was not considered. Now "None in repo" doesn't crash, it should be True for workingctx revision. Behavior of "changeid in repo": revision "null" existing rev None (workingctx) ---------- ------ ------------ ----------------- original* True True TypeError current True True False this patch True True True (*original: ea3acaae25bb)
Mon, 16 Mar 2015 13:41:45 -0500 merge with stable
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 13:41:45 -0500] rev 24319
merge with stable
Mon, 16 Mar 2015 13:32:28 -0500 crecord: fix another underbar
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 13:32:28 -0500] rev 24318
crecord: fix another underbar
Mon, 16 Mar 2015 13:25:19 -0500 crecord: fiddle with vertical whitespace
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 13:25:19 -0500] rev 24317
crecord: fiddle with vertical whitespace
Mon, 16 Mar 2015 13:23:42 -0500 crecord: fix underbar style for orig_stdout
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 13:23:42 -0500] rev 24316
crecord: fix underbar style for orig_stdout
Mon, 16 Mar 2015 13:22:37 -0500 crecord: use encoding.ucolwidth
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 13:22:37 -0500] rev 24315
crecord: use encoding.ucolwidth
Mon, 16 Mar 2015 12:58:06 -0500 crecord: more import style
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 12:58:06 -0500] rev 24314
crecord: more import style
Mon, 16 Mar 2015 12:55:21 -0500 crecord: fix some import style
Matt Mackall <mpm@selenic.com> [Mon, 16 Mar 2015 12:55:21 -0500] rev 24313
crecord: fix some import style
Fri, 13 Mar 2015 22:50:40 -0400 manifest.c: ensure realloc_if_full() returns 1 or 0
Matt Harbison <matt_harbison@yahoo.com> [Fri, 13 Mar 2015 22:50:40 -0400] rev 24312
manifest.c: ensure realloc_if_full() returns 1 or 0 This fixes an MSVC 2008 warning that I don't see with gcc 4.6.3-2: warning C4047: 'return' : 'bool' differs in levels of indirection from 'line *' More importantly, the truncation from pointer to 'unsigned char' would have returned 0 if self->lines pointed to an address divisible by 0xFF, which causes find_lines() to return MANIFEST_OOM. I was able to cause this to happen in a trivial program with the gcc compiler.
Thu, 12 Mar 2015 14:20:32 -0700 record: change recording function to work with crecord
Laurent Charignon <lcharignon@fb.com> [Thu, 12 Mar 2015 14:20:32 -0700] rev 24311
record: change recording function to work with crecord
Thu, 12 Mar 2015 14:19:11 -0700 record: add crecord's ui logic to core
Laurent Charignon <lcharignon@fb.com> [Thu, 12 Mar 2015 14:19:11 -0700] rev 24310
record: add crecord's ui logic to core Code adapted from https://bitbucket.org/edgimar/crecord/src to respect coding convention an record's interface
Wed, 11 Mar 2015 16:39:38 -0700 record: change interface of dorecord to accept new filters
Laurent Charignon <lcharignon@fb.com> [Wed, 11 Mar 2015 16:39:38 -0700] rev 24309
record: change interface of dorecord to accept new filters This makes it easier to add different filtering logic (record /crecord ...)
Wed, 11 Mar 2015 16:18:47 -0700 record: remove duplicated tests
Laurent Charignon <lcharignon@fb.com> [Wed, 11 Mar 2015 16:18:47 -0700] rev 24308
record: remove duplicated tests Since the record and commit -i commands are identical we simplify record's test to just cover the help message and minimal smoke testing.
Wed, 11 Mar 2015 15:54:11 -0700 record: make record use commit -i
Laurent Charignon <lcharignon@fb.com> [Wed, 11 Mar 2015 15:54:11 -0700] rev 24307
record: make record use commit -i
Fri, 13 Mar 2015 17:00:06 -0400 style: kill ersatz if-else ternary operators
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Fri, 13 Mar 2015 17:00:06 -0400] rev 24306
style: kill ersatz if-else ternary operators Although Python supports `X = Y if COND else Z`, this was only introduced in Python 2.5. Since we have to support Python 2.4, it was a very common thing to write instead `X = COND and Y or Z`, which is a bit obscure at a glance. It requires some intricate knowledge of Python to understand how to parse these one-liners. We change instead all of these one-liners to 4-liners. This was executed with the following perlism: find -name "*.py" -exec perl -pi -e 's,(\s*)([\.\w]+) = \(?(\S+)\s+and\s+(\S*)\)?\s+or\s+(\S*)$,$1if $3:\n$1 $2 = $4\n$1else:\n$1 $2 = $5,' {} \; I tweaked the following cases from the automatic Perl output: prev = (parents and parents[0]) or nullid port = (use_ssl and 443 or 80) cwd = (pats and repo.getcwd()) or '' rename = fctx and webutil.renamelink(fctx) or [] ctx = fctx and fctx or ctx self.base = (mapfile and os.path.dirname(mapfile)) or '' I also added some newlines wherever they seemd appropriate for readability There are probably a few ersatz ternary operators still in the code somewhere, lurking away from the power of a simple regex.
Fri, 13 Mar 2015 14:20:13 -0400 cvsps: use a different tiebreaker to avoid flaky test
Augie Fackler <raf@durin42.com> [Fri, 13 Mar 2015 14:20:13 -0400] rev 24305
cvsps: use a different tiebreaker to avoid flaky test After adding some sneaky debug printing[0], I determined that this test flaked when a CVS commit containing two files starts too close to the end of a second, thus putting file "a" in one second and "b/c" in the following second. The secondary sort key meant that these changes sorted in a different order when the timestamps were different than they did when they matched. As far as I can tell, CVS walks through the files in a stable order, so by sorting on the filenames in cvsps we'll get stable output. It's fine for us to switch from sorting on the branchpoint as a secondary key because this was already the point when we didn't care, and we're just trying to break ties in a stable way. It's unclear to be if having the branchpoint present matters anymore, but it doesn't really hurt to leave it. With this change in place, I was able to run test-convert-cvs over 650 times in a row without a failure. test-convert-cvcs-synthetic.t appears to still be flaky, but I don't think it's *worse* than it was before - just not better (I observed one flaky failure in 200 runs on that test). 0: The helpful debug hack ended up being this, in case it's useful to future flaky test assassins: --- a/hgext/convert/cvsps.py +++ b/hgext/convert/cvsps.py @@ -854,6 +854,8 @@ def debugcvsps(ui, *args, **opts): ui.write(('Branch: %s\n' % (cs.branch or 'HEAD'))) ui.write(('Tag%s: %s \n' % (['', 's'][len(cs.tags) > 1], ','.join(cs.tags) or '(none)'))) + if cs.comment == 'ci1' and (cs.id == 6) == bool(cs.branchpoints): + ui.write('raw timestamp %r\n' % (cs.date,)) if cs.branchpoints: ui.write(('Branchpoints: %s \n') % ', '.join(sorted(cs.branchpoints)))
Sat, 14 Mar 2015 22:34:27 +0900 templates: fix "log -q" output of default style stable
Yuya Nishihara <yuya@tcha.org> [Sat, 14 Mar 2015 22:34:27 +0900] rev 24304
templates: fix "log -q" output of default style It was changed at 0ded0f0b1c04 unintentionally due to name conflicts.
(0) -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip