Tue, 31 Mar 2015 22:35:12 -0700 json: implement {changeset} template
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2015 22:35:12 -0700] rev 24563
json: implement {changeset} template Output only contains basic changeset information for the moment. The format is compatible with `hg log -Tjson`.
Tue, 31 Mar 2015 21:49:10 -0700 test-hgweb-json: fix URL for file revision tests
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2015 21:49:10 -0700] rev 24562
test-hgweb-json: fix URL for file revision tests Likely a copy and paste fail.
Tue, 31 Mar 2015 19:34:37 -0700 dirstate._normalize: don't construct dirfoldmap if not necessary
Siddharth Agarwal <sid0@fb.com> [Tue, 31 Mar 2015 19:34:37 -0700] rev 24561
dirstate._normalize: don't construct dirfoldmap if not necessary Constructing the dirfoldmap is expensive, so if there's a hit in the filefoldmap, don't construct the directory foldmap. This helps with cases like 'hg add foo' where foo is already tracked: for a large repository, the operation goes from 1.5 seconds to 1.2 (which is still way too much, but that's a matter for another day.)
Tue, 31 Mar 2015 19:29:39 -0700 dirstate.walk: don't keep track of normalized files in parallel
Siddharth Agarwal <sid0@fb.com> [Tue, 31 Mar 2015 19:29:39 -0700] rev 24560
dirstate.walk: don't keep track of normalized files in parallel Rev 2bb13f2b778c changed the semantics of the work list to store (normalized, non-normalized) pairs. All the tuple creation and destruction hurts perf: on a large repo on OS X, 'hg status' went from 3.62 seconds to 3.78. It also is unnecessary in most cases: - it is clearly unnecessary on case-sensitive filesystems. - it is also unnecessary when filenames have been read off of disk rather than being supplied by the user. The only case where the non-normalized case is required at all is when the file is unknown. To eliminate most of the perf cost, keep trace of whether the directory needs to be normalized at all with a boolean called 'alreadynormed'. Pay the cost of directory normalization only when necessary. For the above large repo, 'hg status' goes to 3.63 seconds.
Tue, 31 Mar 2015 19:18:27 -0700 dirstate.walk: factor out directory traversal
Siddharth Agarwal <sid0@fb.com> [Tue, 31 Mar 2015 19:18:27 -0700] rev 24559
dirstate.walk: factor out directory traversal This function will be used in upcoming patches.
Wed, 01 Apr 2015 13:27:56 -0500 Added signature for changeset 2e2e9a0750f9 stable
Matt Mackall <mpm@selenic.com> [Wed, 01 Apr 2015 13:27:56 -0500] rev 24558
Added signature for changeset 2e2e9a0750f9
Wed, 01 Apr 2015 13:27:42 -0500 Added tag 3.3.3 for changeset 2e2e9a0750f9 stable
Matt Mackall <mpm@selenic.com> [Wed, 01 Apr 2015 13:27:42 -0500] rev 24557
Added tag 3.3.3 for changeset 2e2e9a0750f9
Tue, 31 Mar 2015 20:20:17 -0300 i18n-pt_BR: synchronized with d09262d6ec23 stable 3.3.3
Wagner Bruna <wbruna@softwareexpress.com.br> [Tue, 31 Mar 2015 20:20:17 -0300] rev 24556
i18n-pt_BR: synchronized with d09262d6ec23
Tue, 31 Mar 2015 18:09:21 -0500 tests: fix py2.4 glob for devel warnings
Matt Mackall <mpm@selenic.com> [Tue, 31 Mar 2015 18:09:21 -0500] rev 24555
tests: fix py2.4 glob for devel warnings
Tue, 31 Mar 2015 17:49:46 -0500 merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 31 Mar 2015 17:49:46 -0500] rev 24554
merge with stable
Tue, 31 Mar 2015 15:41:02 -0700 dirstate: fix order of initializing nf vs f
Siddharth Agarwal <sid0@fb.com> [Tue, 31 Mar 2015 15:41:02 -0700] rev 24553
dirstate: fix order of initializing nf vs f Result of a bad merge.
Mon, 30 Mar 2015 18:10:59 -0700 treemanifest: make treemanifest.matches() faster
Drew Gottlieb <drgott@google.com> [Mon, 30 Mar 2015 18:10:59 -0700] rev 24552
treemanifest: make treemanifest.matches() faster By converting treemanifest.matches() into a recursively additivie operation, it becomes O(n). The old matches function made a copy of the entire manifest and deleted files that didn't match. With tree manifests, this was an O(n log n) operation because del() was O(log n). This change speeds up the command "hg status --rev .^ 'relglob:*.js' on the Mozilla repo, now taking 2.53s, down from 3.51s.
Mon, 30 Mar 2015 17:21:49 -0700 treemanifest: add treemanifest._isempty()
Drew Gottlieb <drgott@google.com> [Mon, 30 Mar 2015 17:21:49 -0700] rev 24551
treemanifest: add treemanifest._isempty() During operations that involve building up a new manifest tree, it will be useful to be able to quickly check if a submanifest is empty, and if so, to avoid including it in the final tree. Doing this check lets us avoid creating treemanifest structures that contain any empty submanifests.
Fri, 27 Mar 2015 13:16:13 -0700 treemanifest: remove treemanifest._intersectfiles()
Drew Gottlieb <drgott@google.com> [Fri, 27 Mar 2015 13:16:13 -0700] rev 24550
treemanifest: remove treemanifest._intersectfiles() In preparation for the optimization in the following commit, this commit removes treemanifest.matches()'s call to _intersectfiles(), and removes _intersectfiles() itself since it's unused at this point.
Mon, 30 Mar 2015 11:58:39 -0700 manifest: add some tests for manifest.matches()
Drew Gottlieb <drgott@google.com> [Mon, 30 Mar 2015 11:58:39 -0700] rev 24549
manifest: add some tests for manifest.matches() There were no tests for the various code paths in manifestdict.matches(), so I added some. This also adds a more complex testing manifest so that any bugs relating to traversal of directories are more likely to be caught.
Tue, 31 Mar 2015 17:42:46 -0400 forget: cleanup the output for an inexact case match on icasefs stable
Matt Harbison <matt_harbison@yahoo.com> [Tue, 31 Mar 2015 17:42:46 -0400] rev 24548
forget: cleanup the output for an inexact case match on icasefs Previously, specifying a file name but not matching the dirstate case yielded the following, even though the file was actually removed: $ hg forget capsdir1/capsdir/abc.txt not removing capsdir\a.txt: file is already untracked removing CapsDir\A.txt [1] This change doesn't appear to cause any extra filesystem accesses, even if a nonexistant file is specified. If a directory is specified without a case match, it is (and was previously) still silently ignored.
Mon, 30 Mar 2015 21:37:24 -0700 json: implement {branches} template
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 30 Mar 2015 21:37:24 -0700] rev 24547
json: implement {branches} template
Tue, 31 Mar 2015 14:54:56 -0700 json: implement {bookmarks} template
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2015 14:54:56 -0700] rev 24546
json: implement {bookmarks} template
Tue, 31 Mar 2015 14:52:21 -0700 json: implement {tags} template
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 31 Mar 2015 14:52:21 -0700] rev 24545
json: implement {tags} template Tags is pretty easy to implement. Let's start there. The output is slightly different from `hg tags -Tjson`. For reference, the CLI has the following output: [ { "node": "e2049974f9a23176c2addb61d8f5b86e0d620490", "rev": 29880, "tag": "tip", "type": "" }, ... ] Our output has the format: { "node": "0aeb19ea57a6d223bacddda3871cb78f24b06510", "tags": [ { "node": "e2049974f9a23176c2addb61d8f5b86e0d620490", "tag": "tag1", "date": [1427775457.0, 25200] }, ... ] } "rev" is omitted because it isn't a reliable identifier. We shouldn't be exposing them in web APIs and giving the impression it remotely resembles a stable identifier. Perhaps we could one day hide this behind a config option (it might be useful to expose when running servers locally). The "type" of the tag isn't defined because this information isn't yet exposed to the hgweb templater (it could be in a follow-up) and because it is questionable whether different types should be exposed at all. (Should the web interface really be exposing "local" tags?) We use an object for the outer type instead of Array for a few reasons. First, it is extensible. If we ever need to throw more global properties into the output, we can do that without breaking backwards compatibility (property additions should be backwards compatible). Second, uniformity in web APIs is nice. Having everything return objects seems much saner than a mix of array and object. Third, there are security issues with arrays in older browsers. The JSON web services world almost never uses arrays as the main type for this reason. Another possibly controversial part about this patch is how dates are defined. While JSON has a Date type, it is based on the JavaScript Date type, which is widely considered a pile of garbage. It is a non-starter for this reason. Many of Mercurial's built-in date filters drop seconds resolution. So that's a non-starter as well, since we want the API to be lossless where possible. rfc3339date, rfc822date, isodatesec, and date are all lossless. However, they each require the client to perform string parsing on top of JSON decoding. While date parsing libraries are pretty ubiquitous, some languages don't have them out of the box. However, pretty much every programming language can deal with UNIX timestamps (which are just integers or floats). So, we choose to use Mercurial's internal date representation, which in JSON is modeled as float seconds since UNIX epoch and an integer timezone offset from UTC (keep in mind JavaScript/JSON models all "Numbers" as double prevision floating point numbers, so there isn't a difference between ints and floats in JSON).
Mon, 30 Mar 2015 20:15:03 -0700 templates: add a stub template for json
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 30 Mar 2015 20:15:03 -0700] rev 24544
templates: add a stub template for json Many have long wanted hgweb to emit a common machine readable output. We start the process by defining a stub json template. Right now, each endpoint returns a stub "not yet implemented" string. Individual templates will be implemented in subsequent patches. Basic tests for templates have been included. Coverage isn't perfect, but it is better than nothing.
Mon, 30 Mar 2015 20:56:54 -0700 get-with-headers: support parsing and pretty printing JSON
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 30 Mar 2015 20:56:54 -0700] rev 24543
get-with-headers: support parsing and pretty printing JSON Upcoming patches will add support for JSON output from hgweb. Because JSON output from the templater is hard to read and because it is easy to introduce malformed JSON, we introduce a JSON processing mode to get-with-headers.py that will parse and pretty print JSON from HTTP responses. This will make tests easier to read and write and it will ensure hgweb is emitting well-formed JSON.
Tue, 31 Mar 2015 16:14:14 -0500 merge with stable
Matt Mackall <mpm@selenic.com> [Tue, 31 Mar 2015 16:14:14 -0500] rev 24542
merge with stable
Sun, 29 Mar 2015 19:47:16 -0700 dirstate.walk: use the file foldmap to normalize
Siddharth Agarwal <sid0@fb.com> [Sun, 29 Mar 2015 19:47:16 -0700] rev 24541
dirstate.walk: use the file foldmap to normalize Computing the set of directories in the dirstate is expensive. It turns out that it isn't necessary for operations like 'hg status' at all. Why? Consider the file 'foo/bar' on disk, which is represented in the dirstate as 'FOO/BAR'. On 'hg status', we'd walk down the directory tree, coming across 'foo' first. Before: we'd normalize 'foo' to 'FOO', then add 'FOO' to our visited stack. We'd then visit 'FOO', finding the file 'bar'. We'd normalize 'FOO/bar' to 'FOO/BAR', then add it to the results dict. After: we wouldn't normalize 'foo' at all. We'd add it to our visited stack, then visit 'foo', finding the file 'bar'. We'd normalize 'foo/bar' to 'FOO/BAR', then add it to the results dict. So whether we normalize intermediate directories or not actually makes no difference in most cases. The only case where normalization matters at all is if a file is replaced with a directory with the same case-folded name. In that case we can do a relatively cheap file normalization instead and still get away with not computing the set of directories. This is a nice boost in status performance. On OS X with case-insensitive HFS+, for a large repo with over 200,000 files, this brings down 'hg status' from 4.00 seconds to 3.62.
Sun, 29 Mar 2015 19:42:49 -0700 dirstate: split the foldmap into separate ones for files and directories
Siddharth Agarwal <sid0@fb.com> [Sun, 29 Mar 2015 19:42:49 -0700] rev 24540
dirstate: split the foldmap into separate ones for files and directories Computing the set of directories in the dirstate can be pretty expensive. For 'hg status' without arguments, it turns out we actually never need to figure out the right case for directories in the foldmap. (An upcoming patch explains why.) This patch splits up the directory and file maps into separate ones, allowing for the subsequent optimization in status.
(0) -10000 -3000 -1000 -300 -100 -50 -24 +24 +50 +100 +300 +1000 +3000 +10000 tip