##// END OF EJS Templates
wireprotov2: define and implement "manifestdata" command...
wireprotov2: define and implement "manifestdata" command The added command can be used for obtaining manifest data. Given a manifest path and set of manifest nodes, data about manifests can be retrieved. Unlike changeset data, we wish to emit deltas to describe manifest revisions. So the command uses the relatively new API for building delta requests and emitting them. The code calls into deltaparent(), which I'm not very keen of. There's still work to be done in delta generation land so implementation details of storage (e.g. exactly one delta is stored/available) don't creep into higher levels. But we can worry about this later (there is already a TODO on imanifestorage tracking this). On the subject of parent deltas, the server assumes parent revisions exist on the receiving end. This is obviously wrong for shallow clone. I've added TODOs to add a mechanism to the command to allow clients to specify desired behavior. This shouldn't be too difficult to implement. Another big change is that the client must explicitly request manifest nodes to retrieve. This is a major departure from "getbundle," where the server derives relevant manifests as it iterates changesets and sends them automatically. As implemented, the client must transmit each requested node to the server. At 20 bytes per node, we're looking at 2 MB per 100,000 nodes. Plus wire encoding overhead. This isn't ideal for clients with limited upload bandwidth. I plan to address this in the future by allowing alternate mechanisms for defining the revisions to retrieve. One idea is to define a range of changeset revisions whose manifest revisions to retrieve (similar to how "changesetdata" works). We almost certainly want an API to look up an individual manifest by node. And that's where I've chosen to start with the implementation. Again, a theme of this early exchangev2 work is I want to start by building primitives for accessing raw repository data first and see how far we can get with those before we need more complexity. Differential Revision: https://phab.mercurial-scm.org/D4488

File last commit:

r31472:75e4bae5 default
r39673:c7a7c7e8 default
Show More
test-trusted.py.out
195 lines | 4.5 KiB | text/plain | TextLexer
/ tests / test-trusted.py.out
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 # same user, same group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# same user, different group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, same group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group bar
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, same group, but we trust the group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, different group, but we trust the user
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, different group, but we trust the group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# different user, different group, but we trust the user and the group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# we trust all users
# different user, different group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# we trust all groups
# different user, different group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# we trust all users and groups
# different user, different group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# we don't get confused by users and groups with the same name
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# list of user names
# different user, different group, but we trust the user
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# list of group names
# different user, different group, but we trust the group
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
# Can't figure out the name of the user running this process
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551 global = /some/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 untrusted
. . global = /some/path
. . local = /another/path
Alexis S. L. Carvalho
Only read .hg/hgrc files from trusted users/groups...
r3551
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 # prints debug warnings
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted
Matt Mackall
ui: report_untrusted fixes...
r8204 ignoring untrusted configuration option paths.local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 global = /some/path
untrusted
. . global = /some/path
Pulkit Goyal
tests: make test-trusted use print_function...
r28934 . ignoring untrusted configuration option paths.local = /another/path
Matt Mackall
ui: report_untrusted fixes...
r8204 . local = /another/path
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552
Ry4an Brase
ui: always report untrusted hgrc files when debug enabled...
r13493 # report_untrusted enabled without debug hides warnings
# different user, different group
trusted
global = /some/path
untrusted
. . global = /some/path
. . local = /another/path
# report_untrusted enabled with debug shows warnings
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Ry4an Brase
ui: always report untrusted hgrc files when debug enabled...
r13493 trusted
ignoring untrusted configuration option paths.local = /another/path
global = /some/path
untrusted
. . global = /some/path
Pulkit Goyal
tests: make test-trusted use print_function...
r28934 . ignoring untrusted configuration option paths.local = /another/path
Ry4an Brase
ui: always report untrusted hgrc files when debug enabled...
r13493 . local = /another/path
Matt Mackall
ui: fold readsections into readconfig...
r8142 # ui.readconfig sections
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 quux
# read trusted, untrusted, new ui, trusted
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file foobar from untrusted user abc, group def
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 trusted:
Matt Mackall
ui: report_untrusted fixes...
r8204 ignoring untrusted configuration option foobar.baz = quux
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 None
untrusted:
quux
# error handling
# file doesn't exist
# same user, same group
# different user, different group
# parse error
# different user, different group
Martin Geisler
ui: lowercase "not trusting file" warning message
r16939 not trusting file .hg/hgrc from untrusted user abc, group def
Matt Mackall
error: update test-trusted.py
r11291 ('foo', '.hg/hgrc:1')
Alexis S. L. Carvalho
save settings from untrusted config files in a separate configparser...
r3552 # same user, same group
Matt Mackall
error: update test-trusted.py
r11291 ('foo', '.hg/hgrc:1')
Martijn Pieters
config: honour the trusted flag in ui.configbytes
r31472
# access typed information
# different user, different group
not trusting file .hg/hgrc from untrusted user abc, group def
# suboptions, trusted and untrusted
(None, []) ('main', [('one', 'one'), ('two', 'two')])
# path, trusted and untrusted
None .hg/monty/python
# bool, trusted and untrusted
False True
# int, trusted and untrusted
0 42
# bytes, trusted and untrusted
0 84934656
# list, trusted and untrusted
[] ['spam', 'ham', 'eggs']