Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:45:46 -0700] rev 25166
ignore: rename readignorefile to readpatternfile
A future commit will move the readignorefile logic into match.py so it can be
used from general match rules. Let's rename the function to represent this new
behavior.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:45:06 -0700] rev 25165
ignore: combine readignorefile and _ignorefile
_ignorefile did nothing except open the file. Let's combine it with
readignorefile for simplicity. This will make it easier to rename and move to
match.py in upcoming patches.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:37:59 -0700] rev 25164
ignore: move bad file handling out of readignorefile
In preparation for moving readignorefile to match.py to make it more generally
usable, let's move the bad ignore file handling up to the ignore specific logic.
Durham Goode <durham@fb.com> [Sat, 16 May 2015 15:24:43 -0700] rev 25163
ignore: remove .hgignore from ignore list if nonexistent
Previously we would always pass the root .hgignore path to the ignore parser.
The parser then had to be aware that the first path was special, and not warn if
it didn't exist.
In preparation for making the ignore file parser more generically usable, let's
make the parse logic not aware of this special case, and instead just not pass
the root .hgignore in if it doesn't exist.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:47:18 -0400] rev 25162
run-tests: replace open-coded .decode()s on paths with a helper (
issue4667)
This also cleans up the mkdtemp code mentioned in the previous patch.
At this point, the remaining callsites of .{en,de)code() are in the
following categories:
Handling escaped lines in .t files
-----------------------------------
It seems eminently reasonable to me for us to declare that .t files
are valid utf-8, and that any escape sequences we see in .t files
should be valid unicode_escape sequences.
Making error text safe for cdata blocks for xml error reports
-------------------------------------------------------------
This is a point where we're already basically screwed, and we're
simply trying to do something "good enough" that the xml output will
be vaguely useful to the user. Punting here seems fine, and we should
probably stick to the same encoding here that we used in the previous
section.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:40:12 -0400] rev 25161
run-tests: move unicode-to-bytes operations on paths to a helper (
issue4667)
This doesn't fix the probably-wrong utf-8 encoding choice, it just
starts the process of encapsulating all the path handling in run-tests
in a single place.
One known-path use of .encode() remains: it's related to use of
mkdtemp, and it will be fixed in a followup patch once we have a
companion _strpath() helper function to go from bytes to a str, as we
need to file a bug about mkdtemp upstream.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:26:04 -0400] rev 25160
run-tests: insist that if people use Python 3, they use 3.5.x
We depend on both stdlib functionality (difflib.diff_bytes) and
language behavior (bytes formatting) introduced in 3.5, so let's try
and prevent some useless bug reports before they happen.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:18:56 -0400] rev 25159
run-tests: move all open-coded sys.version_info checks to PYTHON3 (
issue4668)
This consolidates all version checking in a single place and helps the
code read more obviously.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:17:13 -0400] rev 25158
run-tests: prefer PYTHON3 constant to many version_info checks (
issue4668)
We only support Python 2.6, 2.7, and 3.5 here, so we can simplify the
code and improve the warning.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:12:33 -0400] rev 25157
run-tests: introduce PYTHON3 boolean constant (
issue4668)
This will avoid open-coding lots of version_info checks later in the
file.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:15:45 -0400] rev 25156
run-tests: drop subprocess _cleanup monkeypatch
This was working around a defect in subprocess in Python 2.5, which we
no longer need to worry about.
Augie Fackler <augie@google.com> [Sun, 17 May 2015 21:15:04 -0400] rev 25155
run-tests: drop wifexited polyfill
os.WIFEXITED exists as of python 2.6 for me, so we no longer need this
polyfill.
Matt Harbison <matt_harbison@yahoo.com> [Mon, 18 May 2015 11:43:10 -0400] rev 25154
test-import: update for no-execbit platforms with
1ef96a3b8b89
Matt Harbison <matt_harbison@yahoo.com> [Mon, 18 May 2015 11:37:29 -0400] rev 25153
test-treemanifest: add globs for Windows
Augie Fackler <augie@google.com> [Sat, 16 May 2015 14:37:24 -0400] rev 25152
util: drop any() and all() polyfills
Augie Fackler <augie@google.com> [Sat, 16 May 2015 14:34:19 -0400] rev 25151
cleanup: use __builtins__.all instead of util.all
Augie Fackler <augie@google.com> [Sat, 16 May 2015 14:34:04 -0400] rev 25150
check-code: un-ban __builtins__.all now that we're on 2.6
Augie Fackler <augie@google.com> [Sat, 16 May 2015 14:30:07 -0400] rev 25149
cleanup: use __builtins__.any instead of util.any
any() is available in all Python versions we support now.
Augie Fackler <augie@google.com> [Sat, 16 May 2015 14:31:03 -0400] rev 25148
check-code: un-ban any() now that we're on 2.6
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 17 May 2015 18:11:02 -0700] rev 25147
walkchangerevs: replace try/except with 'next'
Again, this make the code clearer.
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 17 May 2015 18:06:09 -0700] rev 25146
generatorset: use 'next()' to simplify the code
The 'next()' built-in accept a default value. This remove the needs to check if
self non-empty before returning a value.
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 17 May 2015 18:00:38 -0700] rev 25145
revset: use 'next()' to detect end of iteration in 'last'
The 'next()' built-in can return a default value, allow to get rid of the
confusing try/except code flow.
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 17 May 2015 17:58:39 -0700] rev 25144
revset: use 'next()' to detect end of iteration in 'limit'
The 'next()' built-in can return a default value, allow to get rid of the
confusing try/except code flow.
Pierre-Yves David <pierre-yves.david@fb.com> [Sun, 17 May 2015 17:54:58 -0700] rev 25143
_revancestors: use 'next' to remove the verbose try except clauses
The 'next()' built-in can return a default value, making the final iteration
case simpler and clearer.