Mercurial > hg
view tests/test-eol-clone.t @ 38530:c82ea938efbb
repository: define manifest interfaces
The long march towards declaring interfaces for repository
primitives continues.
This commit essentially defines interfaces based on the following
types:
* manifest.manifestdict -> imanifestdict
* manifest.manifestlog -> imanifestlog
* manifest.memmanifestctx -> imanifestrevisionwritable
* manifest.manifestctx -> imanifestrevisionstored
* manifest.memtreemanifestctx -> imanifestrevisionwritable
* manifest.treemanifestctx -> imanifestrevisionstored
* util.dirs -> idirs
The interfaces are thoroughly documented. Their documentation is
now better than the documentation in manifest.py in many cases.
With the exception of util.dirs, classes have been annotated with
their interfaces. (I didn't feel like util.dirs needed the
proper interface treatment.)
Tests have been added demonstrating that all classes and instances
conform to their interfaces.
This work was much easier than filelogs. That's because Durham
did an excellent job formalizing the manifest API a while back.
There are still some minor kludges with the interfaces that should
probably be addressed. But the primary goal with interface
declarations is getting something established. Once we have an
interface, we can modify it later easily enough.
Differential Revision: https://phab.mercurial-scm.org/D3869
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 30 Jun 2018 18:34:33 -0700 |
parents | eb586ed5d8ce |
children | 7699d9237a67 |
line wrap: on
line source
Testing cloning with the EOL extension $ cat >> $HGRCPATH <<EOF > [extensions] > eol = > > [eol] > native = CRLF > EOF setup repository $ hg init repo $ cd repo $ cat > .hgeol <<EOF > [patterns] > **.txt = native > EOF $ printf "first\r\nsecond\r\nthird\r\n" > a.txt $ hg commit --addremove -m 'checkin' adding .hgeol adding a.txt Clone $ cd .. $ hg clone repo repo-2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-2 $ cat a.txt first\r (esc) second\r (esc) third\r (esc) $ hg cat a.txt first second third $ hg remove .hgeol $ hg commit -m 'remove eol' $ hg push --quiet $ cd .. Test clone of repo with .hgeol in working dir, but no .hgeol in tip $ hg clone repo repo-3 updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-3 $ cat a.txt first second third Test clone of revision with .hgeol $ cd .. $ hg clone -r 0 repo repo-4 adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files new changesets 90f94e2cf4e2 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd repo-4 $ cat .hgeol [patterns] **.txt = native $ cat a.txt first\r (esc) second\r (esc) third\r (esc) $ cd ..