Mercurial > hg-stable
view tests/test-diff-subdir.t @ 39855:d89d5bc06eaa
localrepo: define "features" on repository instances (API)
There are a handful of attributes/methods on repository instances that
describe the behavior of the repository. Furthermore, there is
an unbound set of repository descriptors that we may wish to expose.
For example, an extension may wish to add a descriptor and have
monkeypatched functions look for the presence of an attribute before
taking actions.
This commit introduces a "features" mechanism to allow repositories
to self-advertise an arbitrary set of strings that describe repository
behavior or capabilities.
We implement basic support for advertising a few features to give an
idea of what I want to use this for.
Differential Revision: https://phab.mercurial-scm.org/D4709
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 19 Sep 2018 14:36:57 -0700 |
parents | 16961d43dc89 |
children |
line wrap: on
line source
$ hg init $ mkdir alpha $ touch alpha/one $ mkdir beta $ touch beta/two $ hg add alpha/one beta/two $ hg ci -m "start" $ echo 1 > alpha/one $ echo 2 > beta/two everything $ hg diff --nodates diff -r 7d5ef1aea329 alpha/one --- a/alpha/one +++ b/alpha/one @@ -0,0 +1,1 @@ +1 diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 beta only $ hg diff --nodates beta diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates . diff -r 7d5ef1aea329 beta/two --- a/beta/two +++ b/beta/two @@ -0,0 +1,1 @@ +2 relative to beta $ cd .. $ hg diff --nodates --root beta diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 inside beta $ cd beta $ hg diff --nodates --root . diff -r 7d5ef1aea329 two --- a/two +++ b/two @@ -0,0 +1,1 @@ +2 $ cd ..