Sun, 14 Jan 2018 18:12:51 -0500 lfs: control tracked file selection via a tracked file
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jan 2018 18:12:51 -0500] rev 35665
lfs: control tracked file selection via a tracked file Since the lfs tracking policy can dramatically affect the repository, it makes more sense to have the policy file checked in, than to rely on all developers configuring their .hgrc properly. The inspiration for this is the .hgeol file. The configuration lives under '[track]', so that other things can be added in the future. Eventually, the config option should be limited to `convert` only. If the file can't be parsed for any reason (including unrecognized elements of the minifileset language), the commit will abort until the problem is corrected. This seems more useful than the warning that hgeol emits, and has no effect on reading the data, so there's no compatibility concerns. My initial thought was to read the file and change each "key = value" line into "((key) & (value))", so that each line could be ORed together, and make a single pass at compiling. Unfortunately, that prevents exclusions if there's a catchall rule. Consider what happens to a large *.c file here: [track] **.c = none() ** = size('>1MB') # ((**.c) & (none())) | ((**) & (size('>1MB'))) => anything > 1MB I also thought about having separate [include] and [exclude] sections. But that just seems to open things up to user mistakes. Consider: [include] **.zip = all() **.php = size('>10MB') [exclude] **.zip = all() # Who wins? **.php = none() # Effectively 'all()' (i.e. nothing excluded), or >10MB ? Therefore, it just compiles each key and value separately, and walks until the key matches something. I'm not sure how to enforce just file patterns on LHS without leaking knowledge about the minifileset here. That means this will allow odd looking lines like this: [track] **.c | **.txt = none() But that's also fewer lines to compile, so slightly more efficient? Some things like 'none()' won't work as expected on LHS though, because that won't match, so that line is skipped. For now, these quirks are not mentioned in the documentation. Jun previously expressed concern about efficiency when scaling to large repos, so I tried avoiding 'repo[None]'. (localrepo.commit() gets repo[None] already, but doesn't tie it to the workingcommitctx used here.) Therefore, I looked at the passed context for 'AMR' status. But that doesn't help with the normal case where the policy file is tracked, but clean. That requires looking up p1() to read the file. I don't see any way to get the content of one file without first creating the full parent context.
Sun, 14 Jan 2018 01:04:45 -0500 lfs: move the tracked file function creation to a method
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jan 2018 01:04:45 -0500] rev 35664
lfs: move the tracked file function creation to a method Once a commitable file format for tracked config is agreed upon, I can't see any reason to have a config based way to control this. (Other than convert. That will be necessary to override the file when converting to normal files. Also, converting to lfs needs this if not splicing the file in at the beginning. So maybe the existing config option should be `convert` specific.) Looking to hgeol for precedent, it looks like policy that affects how items are stored are handled only by the tracked file, while policy that affects the checkout can be handled by either a user config or the tracked file (but the latter takes precedence). We probably need a transition period, so this transition policy can be controlled by the function. Additionally, it provides a place for convert to wrap to override the file based config.
Tue, 16 Jan 2018 20:15:07 -0500 lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'`
Matt Harbison <matt_harbison@yahoo.com> [Tue, 16 Jan 2018 20:15:07 -0500] rev 35663
lfs: allow the pointer file to be viewed with `hg cat -T '{rawdata}'` The only other interface to this data is `hg debugdata`, which requires knowledge of the filelog revision that corresponds to the changeset. Since the data is uninterpreted, this is an important debugging capability, and needs to be simpler to use than that. For non-LFS files, this displays the regular data. Alternately, we could forego the messy function extraction in the last patch if this template keyword can just be added unconditionally.
Tue, 16 Jan 2018 19:56:00 -0500 cat: factor out a function that populates the formatter
Matt Harbison <matt_harbison@yahoo.com> [Tue, 16 Jan 2018 19:56:00 -0500] rev 35662
cat: factor out a function that populates the formatter This will allow extensions to add data to the templater.
Sun, 14 Jan 2018 12:07:06 -0500 svnsubrepo: add new method _svnmissing
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Sun, 14 Jan 2018 12:07:06 -0500] rev 35661
svnsubrepo: add new method _svnmissing This is modelled after _gitmissing from dea6efdd7ec4 and also necessary for svn. I'm not sure exactly how this hasn't been more of a problem for svn until now, actually.
Sun, 14 Jan 2018 12:05:28 -0500 svnsubrepo: decorate dirty method with annotatesubrepoerror
Jordi Gutiérrez Hermoso <jordigh@octave.org> [Sun, 14 Jan 2018 12:05:28 -0500] rev 35660
svnsubrepo: decorate dirty method with annotatesubrepoerror This function invokes svn commands which can error out in any number of ways, so it's helpful to know in which subrepo this error happens.
Tue, 16 Jan 2018 22:14:33 +0900 match: do not weirdly include explicit files excluded by -X option
Yuya Nishihara <yuya@tcha.org> [Tue, 16 Jan 2018 22:14:33 +0900] rev 35659
match: do not weirdly include explicit files excluded by -X option Actually, this was the original behavior. Before a83a7d27911e, "log" and "files" showed nothing if "FILE -X FILE" was specified, whereas "debugwalk" got confused by an explicit FILE pattern. Under the hood, "log" and "files" use m() and ctx.matches(m) respectively, and "debugwalk" uses ctx.walk(m). I suspect dirstate.walk() goes wrong in _walkexplicit(), which seems to blindly trust m.files(). I reckon the original "log"/"files" behavior is correct, and drop the hack from the differencematcher.
Sun, 14 Jan 2018 15:56:22 -0500 lfs: add the '{oid}' template keyword to '{lfs_files}'
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jan 2018 15:56:22 -0500] rev 35658
lfs: add the '{oid}' template keyword to '{lfs_files}' The 'sha256:' prefix is skipped because this seems like the most convenient way to consume it. Maybe we should also add a '{oid_type}' keyword? Then again, that can be added in the future if a different algorithm is supported.
Sun, 14 Jan 2018 15:39:10 -0500 lfs: convert '{lfs_files}' keyword to a hybrid list
Matt Harbison <matt_harbison@yahoo.com> [Sun, 14 Jan 2018 15:39:10 -0500] rev 35657
lfs: convert '{lfs_files}' keyword to a hybrid list This will allow more attributes about the file to be queried.
Sun, 10 Dec 2017 21:42:33 +0100 showstack: add an extension docstring
Boris Feld <boris.feld@octobus.net> [Sun, 10 Dec 2017 21:42:33 +0100] rev 35656
showstack: add an extension docstring Now, running `hg help showstack` will give details on how to use the extension.
Mon, 15 Jan 2018 10:44:49 +0000 bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey'
Boris Feld <boris.feld@octobus.net> [Mon, 15 Jan 2018 10:44:49 +0000] rev 35655
bookmark: run 'pushkey' hooks after bookmark move, not 'prepushkey' This was a silly copy paste mistake. Spotted by Mitchell Plamann from Jane Street.
Mon, 15 Jan 2018 19:44:18 +0800 hgweb: remove unused second argument of nextPageVarGet()
Anton Shestakov <av6@dwimlabs.net> [Mon, 15 Jan 2018 19:44:18 +0800] rev 35654
hgweb: remove unused second argument of nextPageVarGet() nextPageVarGet is a function that's used in ajaxScrollInit() to produce URL of the next page. Before f84b01257e06, its second argument previousVal was a number on /graph pages, and the code was simply adding 60 to it and returning the resulting value. Now previousVal can only be a string containing changeset hash, which can't be used the same way (and in fact isn't used in any way).
Sun, 14 Jan 2018 20:06:56 -0800 dispatch: handle IOError when writing to stderr
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 14 Jan 2018 20:06:56 -0800] rev 35653
dispatch: handle IOError when writing to stderr Previously, attempts to write to stderr in dispatch.run() may lead to an exception being thrown. This would likely be handled by Python's default exception handler, which would print the exception and exit 1. Code in this function is already catching IOError for stdout failures and converting to exit code 255 (-1 & 255 == 255). Why we weren't doing the same for stderr for the sake of consistency, I don't know. I do know that chg and hg diverged in behavior here (as the changed test-basic.t shows). After this commit, we catch I/O failure on stderr and change the exit code to 255. chg and hg now behave consistently. As a bonus, Rust hg also now passes this test. I'm skeptical at changing the exit code due to failures this late in the process. I think we should consider preserving the current exit code - assuming it is non-0. And, we may want to preserve the exit code completely if the I/O error is EPIPE (and potentially other special error classes). There's definitely room to tweak behavior. But for now, let's at least prevent the uncaught exception. Differential Revision: https://phab.mercurial-scm.org/D1860
Sun, 14 Jan 2018 19:30:48 -0800 commandserver: restore cwd in case of exception
Gregory Szorc <gregory.szorc@gmail.com> [Sun, 14 Jan 2018 19:30:48 -0800] rev 35652
commandserver: restore cwd in case of exception The order of the statements was also changed a bit. But it shouldn't matter. Differential Revision: https://phab.mercurial-scm.org/D1859
Wed, 10 Jan 2018 20:02:35 -0800 tests: make hg frame optional
Gregory Szorc <gregory.szorc@gmail.com> [Wed, 10 Jan 2018 20:02:35 -0800] rev 35651
tests: make hg frame optional When `hg` is a Rust binary, the `hg` frame doesn't exist because an `hg` Python script doesn't exist. This commit updates expected test output to make the `hg` frame optional. There /might/ be a way to do this more accurately with the "(feature !)" syntax in .t files. However, I poked at it for a few minutes and couldn't get it to work. Worst case with using (?) is we drop the frame from output for Python `hg`. The `hg` frame isn't terribly important. So the worst case doesn't feel that bad. If someone wants to enlighten me on how to use "(feature !)" for optional output based on hghave features, I'd be more than willing to update this. Differential Revision: https://phab.mercurial-scm.org/D1858
Sat, 13 Jan 2018 22:40:33 -0500 test-lfs: add tests to show that hashes remain unchanged by conversions
Matt Harbison <matt_harbison@yahoo.com> [Sat, 13 Jan 2018 22:40:33 -0500] rev 35650
test-lfs: add tests to show that hashes remain unchanged by conversions This is a very cool feature that we should document, but I'll punt that to the freeze. From what I can tell, git doesn't have this capability.
Sat, 13 Jan 2018 22:29:18 -0500 test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Matt Harbison <matt_harbison@yahoo.com> [Sat, 13 Jan 2018 22:29:18 -0500] rev 35649
test-lfs: drop an unresolved issue note, now that lfs.track=none() is a thing
Sat, 13 Jan 2018 20:07:14 -0500 lfs: always exclude '.hg*' text files
Matt Harbison <matt_harbison@yahoo.com> [Sat, 13 Jan 2018 20:07:14 -0500] rev 35648
lfs: always exclude '.hg*' text files I can't think of any problematic scenarios (though things might get interesting with .hgtags, since every head is consulted). The eol extension explicitly disables handling these files, and that seems reasonable here too.
Mon, 15 Jan 2018 00:16:11 +0530 bookmarks: calculate visibility exceptions only once
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 15 Jan 2018 00:16:11 +0530] rev 35647
bookmarks: calculate visibility exceptions only once In the loop "for mark in names", the rev is same in each iteration, so it does not makes sense to call unhidehashlikerevs multiple times. Thanks to Yuya for spotting this.
Sun, 10 Dec 2017 18:25:33 +0900 log: rewrite --follow-first -rREV like --follow for consistency (BC)
Yuya Nishihara <yuya@tcha.org> [Sun, 10 Dec 2017 18:25:33 +0900] rev 35646
log: rewrite --follow-first -rREV like --follow for consistency (BC) This helps fixing the "--follow -rREV PATH" issue. .. bc:: ``log --follow-first -rREV``, which is deprecated, now follows the first parent of merge revisions from the specified ``REV`` just like ``log --follow -rREV``.
Tue, 02 Jan 2018 17:37:01 +0900 log: use revsetlang.formatspec() thoroughly
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 17:37:01 +0900] rev 35645
log: use revsetlang.formatspec() thoroughly This patch replaces %(val)s and %(val)r with %r (expression) and %s (string) respectively. _matchfiles() is the exception as it takes a list of string parameters. "--prune REV" could take a revset expression if it were "ancestors(%(val)s)", but this patch doesn't change the existing behavior.
Tue, 02 Jan 2018 17:13:18 +0900 log: use revsetlang.formatspec() to concatenate list expression
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 17:13:18 +0900] rev 35644
log: use revsetlang.formatspec() to concatenate list expression This rewrites 'not ancestors(x) and not ...' as 'not (ancestors(x) or ...)' so we can use '%lr'. 'isinstance(val, list)' is replaced with 'listop' to make sure 'listop' is applied.
Tue, 02 Jan 2018 17:00:48 +0900 log: simplify 'x or ancestors(x)' expression
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 17:00:48 +0900] rev 35643
log: simplify 'x or ancestors(x)' expression 'ancestors(x)' includes 'x'.
Tue, 02 Jan 2018 16:58:37 +0900 log: make opt2revset table a module constant
Yuya Nishihara <yuya@tcha.org> [Tue, 02 Jan 2018 16:58:37 +0900] rev 35642
log: make opt2revset table a module constant Just makes it clear that the table isn't updated in _makelogrevset().
Sun, 14 Jan 2018 13:04:26 -0800 revlog: group revision info into a dedicated structure
Paul Morelle <paul.morelle@octobus.net> [Sun, 14 Jan 2018 13:04:26 -0800] rev 35641
revlog: group revision info into a dedicated structure
Sun, 14 Jan 2018 13:01:35 -0800 revlog: rename 'rev' to 'base', as it is the base revision
Paul Morelle <paul.morelle@octobus.net> [Sun, 14 Jan 2018 13:01:35 -0800] rev 35640
revlog: rename 'rev' to 'base', as it is the base revision
Sun, 14 Jan 2018 12:59:46 -0800 revlog: separate diff computation from the collection of other info
Paul Morelle <paul.morelle@octobus.net> [Sun, 14 Jan 2018 12:59:46 -0800] rev 35639
revlog: separate diff computation from the collection of other info
Fri, 12 Jan 2018 18:58:44 +0100 revlog: introduce 'deltainfo' to distinguish from 'delta'
Paul Morelle <paul.morelle@octobus.net> [Fri, 12 Jan 2018 18:58:44 +0100] rev 35638
revlog: introduce 'deltainfo' to distinguish from 'delta' A 'delta' is a binary diff between two revisions, as returned by revdiff. A 'deltainfo' is an object storing information about a delta, including the 'delta' itself. Formerly, it was stored in a 7-position tuple, which was less readable.
Fri, 12 Jan 2018 18:10:03 +0100 revlog: extract 'builddelta' closure function from _addrevision
Paul Morelle <paul.morelle@octobus.net> [Fri, 12 Jan 2018 18:10:03 +0100] rev 35637
revlog: extract 'builddelta' closure function from _addrevision
Fri, 12 Jan 2018 15:55:25 +0100 revlog: extract 'buildtext' closure function from _addrevision
Paul Morelle <paul.morelle@octobus.net> [Fri, 12 Jan 2018 15:55:25 +0100] rev 35636
revlog: extract 'buildtext' closure function from _addrevision
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -30 +30 +50 +100 +300 +1000 +3000 +10000 tip