2014-05-17 00:18:57 +04:00
|
|
|
This file contains testcases that tend to be related to special cases or less
|
|
|
|
common commands affecting largefile.
|
|
|
|
|
|
|
|
Each sections should be independent of each others.
|
|
|
|
|
|
|
|
$ USERCACHE="$TESTTMP/cache"; export USERCACHE
|
|
|
|
$ mkdir "${USERCACHE}"
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> largefiles=
|
|
|
|
> purge=
|
|
|
|
> rebase=
|
|
|
|
> transplant=
|
|
|
|
> [phases]
|
|
|
|
> publish=False
|
|
|
|
> [largefiles]
|
|
|
|
> minsize=2
|
|
|
|
> patterns=glob:**.dat
|
|
|
|
> usercache=${USERCACHE}
|
|
|
|
> [hooks]
|
|
|
|
> precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Test copies and moves from a directory other than root (issue3516)
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
$ hg init lf_cpmv
|
|
|
|
$ cd lf_cpmv
|
|
|
|
$ mkdir dira
|
|
|
|
$ mkdir dira/dirb
|
|
|
|
$ touch dira/dirb/largefile
|
|
|
|
$ hg add --large dira/dirb/largefile
|
|
|
|
$ hg commit -m "added"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A dira/dirb/largefile
|
|
|
|
$ cd dira
|
|
|
|
$ hg cp dirb/largefile foo/largefile
|
2015-04-18 20:08:41 +03:00
|
|
|
|
|
|
|
TODO: Ideally, this should mention the largefile, not the standin
|
|
|
|
$ hg log -T '{rev}\n' --stat 'set:clean()'
|
|
|
|
0
|
|
|
|
.hglf/dira/dirb/largefile | 1 +
|
|
|
|
1 files changed, 1 insertions(+), 0 deletions(-)
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg ci -m "deep copy"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A dira/foo/largefile
|
|
|
|
$ find . | sort
|
|
|
|
.
|
|
|
|
./dirb
|
|
|
|
./dirb/largefile
|
|
|
|
./foo
|
|
|
|
./foo/largefile
|
|
|
|
$ hg mv foo/largefile baz/largefile
|
|
|
|
$ hg ci -m "moved"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A dira/baz/largefile
|
|
|
|
R dira/foo/largefile
|
|
|
|
$ find . | sort
|
|
|
|
.
|
|
|
|
./baz
|
|
|
|
./baz/largefile
|
|
|
|
./dirb
|
|
|
|
./dirb/largefile
|
|
|
|
$ cd ..
|
|
|
|
$ hg mv dira dirc
|
|
|
|
moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
|
|
|
|
moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
|
|
|
|
$ find * | sort
|
|
|
|
dirc
|
|
|
|
dirc/baz
|
|
|
|
dirc/baz/largefile
|
|
|
|
dirc/dirb
|
|
|
|
dirc/dirb/largefile
|
2014-12-01 07:30:31 +03:00
|
|
|
|
|
|
|
$ hg clone -q . ../fetch
|
|
|
|
$ hg --config extensions.fetch= fetch ../fetch
|
|
|
|
abort: uncommitted changes
|
|
|
|
[255]
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg up -qC
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Clone a local repository owned by another user
|
|
|
|
===================================================
|
|
|
|
|
|
|
|
#if unix-permissions
|
|
|
|
|
|
|
|
We have to simulate that here by setting $HOME and removing write permissions
|
|
|
|
$ ORIGHOME="$HOME"
|
|
|
|
$ mkdir alice
|
|
|
|
$ HOME="`pwd`/alice"
|
|
|
|
$ cd alice
|
|
|
|
$ hg init pubrepo
|
|
|
|
$ cd pubrepo
|
|
|
|
$ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
|
|
|
|
$ hg add --large a-large-file
|
|
|
|
$ hg commit -m "Add a large file"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A a-large-file
|
|
|
|
$ cd ..
|
|
|
|
$ chmod -R a-w pubrepo
|
|
|
|
$ cd ..
|
|
|
|
$ mkdir bob
|
|
|
|
$ HOME="`pwd`/bob"
|
|
|
|
$ cd bob
|
|
|
|
$ hg clone --pull ../alice/pubrepo pubrepo
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
|
|
|
updating to branch default
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ cd ..
|
|
|
|
$ chmod -R u+w alice/pubrepo
|
|
|
|
$ HOME="$ORIGHOME"
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
Symlink to a large largefile should behave the same as a symlink to a normal file
|
|
|
|
=====================================================================================
|
|
|
|
|
|
|
|
#if symlink
|
|
|
|
|
|
|
|
$ hg init largesymlink
|
|
|
|
$ cd largesymlink
|
|
|
|
$ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
|
|
|
|
$ hg add --large largefile
|
|
|
|
$ hg commit -m "commit a large file"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A largefile
|
|
|
|
$ ln -s largefile largelink
|
|
|
|
$ hg add largelink
|
|
|
|
$ hg commit -m "commit a large symlink"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A largelink
|
|
|
|
$ rm -f largelink
|
|
|
|
$ hg up >/dev/null
|
|
|
|
$ test -f largelink
|
|
|
|
[1]
|
|
|
|
$ test -L largelink
|
|
|
|
[1]
|
|
|
|
$ rm -f largelink # make next part of the test independent of the previous
|
|
|
|
$ hg up -C >/dev/null
|
|
|
|
$ test -f largelink
|
|
|
|
$ test -L largelink
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
test for pattern matching on 'hg status':
|
|
|
|
==============================================
|
|
|
|
|
|
|
|
|
|
|
|
to boost performance, largefiles checks whether specified patterns are
|
|
|
|
related to largefiles in working directory (NOT to STANDIN) or not.
|
|
|
|
|
|
|
|
$ hg init statusmatch
|
|
|
|
$ cd statusmatch
|
|
|
|
|
|
|
|
$ mkdir -p a/b/c/d
|
|
|
|
$ echo normal > a/b/c/d/e.normal.txt
|
|
|
|
$ hg add a/b/c/d/e.normal.txt
|
|
|
|
$ echo large > a/b/c/d/e.large.txt
|
|
|
|
$ hg add --large a/b/c/d/e.large.txt
|
|
|
|
$ mkdir -p a/b/c/x
|
|
|
|
$ echo normal > a/b/c/x/y.normal.txt
|
|
|
|
$ hg add a/b/c/x/y.normal.txt
|
|
|
|
$ hg commit -m 'add files'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A a/b/c/d/e.large.txt
|
|
|
|
A a/b/c/d/e.normal.txt
|
|
|
|
A a/b/c/x/y.normal.txt
|
|
|
|
|
|
|
|
(1) no pattern: no performance boost
|
|
|
|
$ hg status -A
|
|
|
|
C a/b/c/d/e.large.txt
|
|
|
|
C a/b/c/d/e.normal.txt
|
|
|
|
C a/b/c/x/y.normal.txt
|
|
|
|
|
|
|
|
(2) pattern not related to largefiles: performance boost
|
|
|
|
$ hg status -A a/b/c/x
|
|
|
|
C a/b/c/x/y.normal.txt
|
|
|
|
|
|
|
|
(3) pattern related to largefiles: no performance boost
|
|
|
|
$ hg status -A a/b/c/d
|
|
|
|
C a/b/c/d/e.large.txt
|
|
|
|
C a/b/c/d/e.normal.txt
|
|
|
|
|
|
|
|
(4) pattern related to STANDIN (not to largefiles): performance boost
|
|
|
|
$ hg status -A .hglf/a
|
|
|
|
C .hglf/a/b/c/d/e.large.txt
|
|
|
|
|
|
|
|
(5) mixed case: no performance boost
|
|
|
|
$ hg status -A a/b/c/x a/b/c/d
|
|
|
|
C a/b/c/d/e.large.txt
|
|
|
|
C a/b/c/d/e.normal.txt
|
|
|
|
C a/b/c/x/y.normal.txt
|
|
|
|
|
|
|
|
verify that largefiles doesn't break filesets
|
|
|
|
|
|
|
|
$ hg log --rev . --exclude "set:binary()"
|
|
|
|
changeset: 0:41bd42f10efa
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: add files
|
|
|
|
|
|
|
|
verify that large files in subrepos handled properly
|
|
|
|
$ hg init subrepo
|
|
|
|
$ echo "subrepo = subrepo" > .hgsub
|
|
|
|
$ hg add .hgsub
|
|
|
|
$ hg ci -m "add subrepo"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A .hgsub
|
|
|
|
? .hgsubstate
|
|
|
|
$ echo "rev 1" > subrepo/large.txt
|
2015-01-13 05:44:43 +03:00
|
|
|
$ hg add --large subrepo/large.txt
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg sum
|
|
|
|
parent: 1:8ee150ea2e9c tip
|
|
|
|
add subrepo
|
|
|
|
branch: default
|
|
|
|
commit: 1 subrepos
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 2 draft
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg st
|
|
|
|
$ hg st -S
|
|
|
|
A subrepo/large.txt
|
|
|
|
$ hg ci -S -m "commit top repo"
|
|
|
|
committing subrepository subrepo
|
|
|
|
Invoking status precommit hook
|
|
|
|
A large.txt
|
|
|
|
Invoking status precommit hook
|
|
|
|
M .hgsubstate
|
|
|
|
# No differences
|
|
|
|
$ hg st -S
|
|
|
|
$ hg sum
|
|
|
|
parent: 2:ce4cd0c527a6 tip
|
|
|
|
commit top repo
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2014-05-17 00:18:57 +04:00
|
|
|
$ echo "rev 2" > subrepo/large.txt
|
|
|
|
$ hg st -S
|
|
|
|
M subrepo/large.txt
|
|
|
|
$ hg sum
|
|
|
|
parent: 2:ce4cd0c527a6 tip
|
|
|
|
commit top repo
|
|
|
|
branch: default
|
|
|
|
commit: 1 subrepos
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg ci -m "this commit should fail without -S"
|
2015-03-25 07:55:32 +03:00
|
|
|
abort: uncommitted changes in subrepository 'subrepo'
|
2014-05-17 00:18:57 +04:00
|
|
|
(use --subrepos for recursive commit)
|
|
|
|
[255]
|
|
|
|
|
|
|
|
Add a normal file to the subrepo, then test archiving
|
|
|
|
|
|
|
|
$ echo 'normal file' > subrepo/normal.txt
|
2015-01-04 23:26:26 +03:00
|
|
|
$ touch large.dat
|
2014-12-13 21:33:48 +03:00
|
|
|
$ mv subrepo/large.txt subrepo/renamed-large.txt
|
2014-11-29 05:03:44 +03:00
|
|
|
$ hg addremove -S --dry-run
|
|
|
|
adding large.dat as a largefile
|
|
|
|
removing subrepo/large.txt
|
|
|
|
adding subrepo/normal.txt
|
|
|
|
adding subrepo/renamed-large.txt
|
2014-12-13 21:33:48 +03:00
|
|
|
$ hg status -S
|
|
|
|
! subrepo/large.txt
|
2015-01-04 23:26:26 +03:00
|
|
|
? large.dat
|
2014-12-13 21:33:48 +03:00
|
|
|
? subrepo/normal.txt
|
|
|
|
? subrepo/renamed-large.txt
|
2014-05-17 00:18:57 +04:00
|
|
|
|
2014-11-29 05:03:44 +03:00
|
|
|
$ hg addremove --dry-run subrepo
|
|
|
|
removing subrepo/large.txt (glob)
|
|
|
|
adding subrepo/normal.txt (glob)
|
|
|
|
adding subrepo/renamed-large.txt (glob)
|
|
|
|
$ hg status -S
|
|
|
|
! subrepo/large.txt
|
|
|
|
? large.dat
|
|
|
|
? subrepo/normal.txt
|
|
|
|
? subrepo/renamed-large.txt
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg -R statusmatch addremove --dry-run statusmatch/subrepo
|
|
|
|
removing statusmatch/subrepo/large.txt (glob)
|
|
|
|
adding statusmatch/subrepo/normal.txt (glob)
|
|
|
|
adding statusmatch/subrepo/renamed-large.txt (glob)
|
|
|
|
$ hg -R statusmatch status -S
|
|
|
|
! subrepo/large.txt
|
|
|
|
? large.dat
|
|
|
|
? subrepo/normal.txt
|
|
|
|
? subrepo/renamed-large.txt
|
|
|
|
|
|
|
|
$ hg -R statusmatch addremove --dry-run -S
|
2014-11-29 05:44:41 +03:00
|
|
|
adding large.dat as a largefile
|
2014-11-29 05:03:44 +03:00
|
|
|
removing subrepo/large.txt
|
|
|
|
adding subrepo/normal.txt
|
|
|
|
adding subrepo/renamed-large.txt
|
|
|
|
$ cd statusmatch
|
|
|
|
|
|
|
|
$ mv subrepo/renamed-large.txt subrepo/large.txt
|
2014-11-29 03:50:52 +03:00
|
|
|
$ hg addremove subrepo
|
2014-11-29 05:03:44 +03:00
|
|
|
adding subrepo/normal.txt (glob)
|
|
|
|
$ hg forget subrepo/normal.txt
|
|
|
|
|
2014-11-29 03:50:52 +03:00
|
|
|
$ hg addremove -S
|
2015-01-04 23:26:26 +03:00
|
|
|
adding large.dat as a largefile
|
2014-11-29 05:03:44 +03:00
|
|
|
adding subrepo/normal.txt
|
2015-01-04 23:26:26 +03:00
|
|
|
$ rm large.dat
|
|
|
|
|
2014-11-29 03:50:52 +03:00
|
|
|
$ hg addremove subrepo
|
|
|
|
$ hg addremove -S
|
2015-01-04 23:26:26 +03:00
|
|
|
removing large.dat
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
Lock in subrepo, otherwise the change isn't archived
|
|
|
|
|
|
|
|
$ hg ci -S -m "add normal file to top level"
|
|
|
|
committing subrepository subrepo
|
|
|
|
Invoking status precommit hook
|
|
|
|
M large.txt
|
|
|
|
A normal.txt
|
|
|
|
Invoking status precommit hook
|
|
|
|
M .hgsubstate
|
|
|
|
$ hg archive -S ../lf_subrepo_archive
|
|
|
|
$ find ../lf_subrepo_archive | sort
|
|
|
|
../lf_subrepo_archive
|
|
|
|
../lf_subrepo_archive/.hg_archival.txt
|
|
|
|
../lf_subrepo_archive/.hgsub
|
|
|
|
../lf_subrepo_archive/.hgsubstate
|
|
|
|
../lf_subrepo_archive/a
|
|
|
|
../lf_subrepo_archive/a/b
|
|
|
|
../lf_subrepo_archive/a/b/c
|
|
|
|
../lf_subrepo_archive/a/b/c/d
|
|
|
|
../lf_subrepo_archive/a/b/c/d/e.large.txt
|
|
|
|
../lf_subrepo_archive/a/b/c/d/e.normal.txt
|
|
|
|
../lf_subrepo_archive/a/b/c/x
|
|
|
|
../lf_subrepo_archive/a/b/c/x/y.normal.txt
|
|
|
|
../lf_subrepo_archive/subrepo
|
|
|
|
../lf_subrepo_archive/subrepo/large.txt
|
|
|
|
../lf_subrepo_archive/subrepo/normal.txt
|
2015-04-08 16:38:46 +03:00
|
|
|
$ cat ../lf_subrepo_archive/.hg_archival.txt
|
|
|
|
repo: 41bd42f10efa43698cc02052ea0977771cba506d
|
|
|
|
node: d56a95e6522858bc08a724c4fe2bdee066d1c30b
|
|
|
|
branch: default
|
|
|
|
latesttag: null
|
|
|
|
latesttagdistance: 4
|
2015-04-08 16:42:37 +03:00
|
|
|
changessincelatesttag: 4
|
2014-05-17 00:18:57 +04:00
|
|
|
|
|
|
|
Test update with subrepos.
|
|
|
|
|
|
|
|
$ hg update 0
|
|
|
|
getting changed largefiles
|
|
|
|
0 largefiles updated, 1 removed
|
|
|
|
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
|
|
|
|
$ hg status -S
|
|
|
|
$ hg update tip
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -S
|
|
|
|
# modify a large file
|
|
|
|
$ echo "modified" > subrepo/large.txt
|
|
|
|
$ hg st -S
|
|
|
|
M subrepo/large.txt
|
|
|
|
# update -C should revert the change.
|
|
|
|
$ hg update -C
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status -S
|
|
|
|
|
2015-02-08 03:40:02 +03:00
|
|
|
$ hg forget -v subrepo/large.txt
|
|
|
|
removing subrepo/large.txt (glob)
|
|
|
|
|
|
|
|
Test reverting a forgotten file
|
|
|
|
$ hg revert -R subrepo subrepo/large.txt
|
|
|
|
$ hg status -SA subrepo/large.txt
|
|
|
|
C subrepo/large.txt
|
|
|
|
|
2014-12-31 05:12:52 +03:00
|
|
|
$ hg rm -v subrepo/large.txt
|
|
|
|
removing subrepo/large.txt (glob)
|
|
|
|
$ hg revert -R subrepo subrepo/large.txt
|
2014-11-29 05:03:44 +03:00
|
|
|
$ rm subrepo/large.txt
|
|
|
|
$ hg addremove -S
|
|
|
|
removing subrepo/large.txt
|
|
|
|
$ hg st -S
|
|
|
|
R subrepo/large.txt
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
Test archiving a revision that references a subrepo that is not yet
|
|
|
|
cloned (see test-subrepo-recursion.t):
|
|
|
|
|
|
|
|
$ hg clone -U . ../empty
|
|
|
|
$ cd ../empty
|
|
|
|
$ hg archive --subrepos -r tip ../archive.tar.gz
|
|
|
|
cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Test addremove, forget and others
|
|
|
|
==============================================
|
|
|
|
|
|
|
|
Test that addremove picks up largefiles prior to the initial commit (issue3541)
|
|
|
|
|
|
|
|
$ hg init addrm2
|
|
|
|
$ cd addrm2
|
|
|
|
$ touch large.dat
|
|
|
|
$ touch large2.dat
|
|
|
|
$ touch normal
|
|
|
|
$ hg add --large large.dat
|
|
|
|
$ hg addremove -v
|
|
|
|
adding large2.dat as a largefile
|
|
|
|
adding normal
|
|
|
|
|
|
|
|
Test that forgetting all largefiles reverts to islfilesrepo() == False
|
|
|
|
(addremove will add *.dat as normal files now)
|
|
|
|
$ hg forget large.dat
|
|
|
|
$ hg forget large2.dat
|
|
|
|
$ hg addremove -v
|
|
|
|
adding large.dat
|
|
|
|
adding large2.dat
|
|
|
|
|
|
|
|
Test commit's addremove option prior to the first commit
|
|
|
|
$ hg forget large.dat
|
|
|
|
$ hg forget large2.dat
|
|
|
|
$ hg add --large large.dat
|
|
|
|
$ hg ci -Am "commit"
|
|
|
|
adding large2.dat as a largefile
|
|
|
|
Invoking status precommit hook
|
|
|
|
A large.dat
|
|
|
|
A large2.dat
|
|
|
|
A normal
|
|
|
|
$ find .hglf | sort
|
|
|
|
.hglf
|
|
|
|
.hglf/large.dat
|
|
|
|
.hglf/large2.dat
|
|
|
|
|
|
|
|
Test actions on largefiles using relative paths from subdir
|
|
|
|
|
|
|
|
$ mkdir sub
|
|
|
|
$ cd sub
|
|
|
|
$ echo anotherlarge > anotherlarge
|
|
|
|
$ hg add --large anotherlarge
|
|
|
|
$ hg st
|
|
|
|
A sub/anotherlarge
|
|
|
|
$ hg st anotherlarge
|
|
|
|
A anotherlarge
|
|
|
|
$ hg commit -m anotherlarge anotherlarge
|
|
|
|
Invoking status precommit hook
|
|
|
|
A sub/anotherlarge
|
|
|
|
$ hg log anotherlarge
|
|
|
|
changeset: 1:9627a577c5e9
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: anotherlarge
|
|
|
|
|
2015-03-02 02:35:29 +03:00
|
|
|
$ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge
|
|
|
|
updated patterns: ['../.hglf/sub/../sub/anotherlarge', '../sub/anotherlarge']
|
|
|
|
1: anotherlarge
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg log -G anotherlarge
|
|
|
|
@ changeset: 1:9627a577c5e9
|
|
|
|
| tag: tip
|
2016-03-23 23:34:47 +03:00
|
|
|
~ user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: anotherlarge
|
|
|
|
|
2015-03-01 07:42:38 +03:00
|
|
|
|
|
|
|
$ hg log glob:another*
|
|
|
|
changeset: 1:9627a577c5e9
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: anotherlarge
|
|
|
|
|
2015-03-01 22:21:54 +03:00
|
|
|
$ hg --debug log -T '{rev}: {desc}\n' -G glob:another*
|
|
|
|
updated patterns: ['glob:../.hglf/sub/another*', 'glob:another*']
|
|
|
|
@ 1: anotherlarge
|
2015-03-01 07:42:38 +03:00
|
|
|
|
|
2016-03-23 23:34:47 +03:00
|
|
|
~
|
2015-03-01 07:42:38 +03:00
|
|
|
|
2015-03-01 22:21:54 +03:00
|
|
|
#if no-msys
|
|
|
|
$ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
|
|
|
|
updated patterns: ['glob:../.hglf/sub/another*']
|
|
|
|
1: anotherlarge
|
|
|
|
|
|
|
|
$ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
|
|
|
|
updated patterns: ['glob:../.hglf/sub/another*']
|
|
|
|
@ 1: anotherlarge
|
|
|
|
|
|
2016-03-23 23:34:47 +03:00
|
|
|
~
|
2015-03-01 22:21:54 +03:00
|
|
|
#endif
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ echo more >> anotherlarge
|
|
|
|
$ hg st .
|
|
|
|
M anotherlarge
|
|
|
|
$ hg cat anotherlarge
|
|
|
|
anotherlarge
|
|
|
|
$ hg revert anotherlarge
|
|
|
|
$ hg st
|
|
|
|
? sub/anotherlarge.orig
|
2015-11-11 02:08:56 +03:00
|
|
|
|
|
|
|
Test orig files go where we want them
|
|
|
|
$ echo moremore >> anotherlarge
|
|
|
|
$ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups'
|
2015-11-16 05:12:13 +03:00
|
|
|
creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub (glob)
|
|
|
|
saving current version of ../.hglf/sub/anotherlarge as $TESTTMP/addrm2/.hg/origbackups/.hglf/sub/anotherlarge.orig (glob)
|
2015-11-11 02:08:56 +03:00
|
|
|
reverting ../.hglf/sub/anotherlarge (glob)
|
2015-11-16 05:12:13 +03:00
|
|
|
creating directory: $TESTTMP/addrm2/.hg/origbackups/sub (glob)
|
2015-11-11 02:08:56 +03:00
|
|
|
found 90c622cf65cebe75c5842f9136c459333faf392e in store
|
|
|
|
found 90c622cf65cebe75c5842f9136c459333faf392e in store
|
|
|
|
$ ls ../.hg/origbackups/sub
|
|
|
|
anotherlarge.orig
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
2015-03-01 07:42:38 +03:00
|
|
|
Test glob logging from the root dir
|
|
|
|
$ hg log glob:**another*
|
|
|
|
changeset: 1:9627a577c5e9
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: anotherlarge
|
|
|
|
|
|
|
|
$ hg log -G glob:**another*
|
|
|
|
@ changeset: 1:9627a577c5e9
|
|
|
|
| tag: tip
|
2016-03-23 23:34:47 +03:00
|
|
|
~ user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: anotherlarge
|
|
|
|
|
2015-03-01 07:42:38 +03:00
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
2015-03-02 02:35:29 +03:00
|
|
|
Log from outer space
|
|
|
|
$ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge'
|
|
|
|
updated patterns: ['addrm2/.hglf/sub/anotherlarge', 'addrm2/sub/anotherlarge']
|
|
|
|
1: anotherlarge
|
|
|
|
$ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge'
|
|
|
|
updated patterns: ['addrm2/.hglf/sub/anotherlarge']
|
|
|
|
1: anotherlarge
|
|
|
|
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
Check error message while exchange
|
|
|
|
=========================================================
|
|
|
|
|
|
|
|
issue3651: summary/outgoing with largefiles shows "no remote repo"
|
|
|
|
unexpectedly
|
|
|
|
|
|
|
|
$ mkdir issue3651
|
|
|
|
$ cd issue3651
|
|
|
|
|
|
|
|
$ hg init src
|
|
|
|
$ echo a > src/a
|
|
|
|
$ hg -R src add --large src/a
|
|
|
|
$ hg -R src commit -m '#0'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A a
|
|
|
|
|
|
|
|
check messages when no remote repository is specified:
|
|
|
|
"no remote repo" route for "hg outgoing --large" is not tested here,
|
|
|
|
because it can't be reproduced easily.
|
|
|
|
|
|
|
|
$ hg init clone1
|
|
|
|
$ hg -R clone1 -q pull src
|
|
|
|
$ hg -R clone1 -q update
|
|
|
|
$ hg -R clone1 paths | grep default
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg -R clone1 summary --large
|
|
|
|
parent: 0:fc0bd45326d3 tip
|
|
|
|
#0
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 1 draft
|
2014-05-17 00:18:57 +04:00
|
|
|
largefiles: (no remote repo)
|
|
|
|
|
|
|
|
check messages when there is no files to upload:
|
|
|
|
|
|
|
|
$ hg -q clone src clone2
|
|
|
|
$ hg -R clone2 paths | grep default
|
|
|
|
default = $TESTTMP/issue3651/src (glob)
|
|
|
|
|
|
|
|
$ hg -R clone2 summary --large
|
|
|
|
parent: 0:fc0bd45326d3 tip
|
|
|
|
#0
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 1 draft
|
2014-05-17 00:18:57 +04:00
|
|
|
largefiles: (no files to upload)
|
|
|
|
$ hg -R clone2 outgoing --large
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
largefiles: no files to upload
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg -R clone2 outgoing --large --graph --template "{rev}"
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
no changes found
|
|
|
|
largefiles: no files to upload
|
|
|
|
|
|
|
|
check messages when there are files to upload:
|
|
|
|
|
|
|
|
$ echo b > clone2/b
|
|
|
|
$ hg -R clone2 add --large clone2/b
|
|
|
|
$ hg -R clone2 commit -m '#1'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A b
|
|
|
|
$ hg -R clone2 summary --large
|
|
|
|
parent: 1:1acbe71ce432 tip
|
|
|
|
#1
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 2 draft
|
largefiles: show also how many data entities are outgoing at "hg summary"
Before this patch, "hg summary --large" shows how many largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the number of outgoing largefiles shown in
"hg summary" output, users should expect that the former below costs
much more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
summary" by counting number of unique hash values for outgoing
largefiles.
This patch introduces "_getoutgoings" to centralize the logic
(de-duplication, too) into it for convenience of subsequent patches,
even though it is not required in "hg summary" case.
2014-07-07 13:45:46 +04:00
|
|
|
largefiles: 1 entities for 1 files to upload
|
2014-05-17 00:18:57 +04:00
|
|
|
$ hg -R clone2 outgoing --large
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
changeset: 1:1acbe71ce432
|
|
|
|
tag: tip
|
|
|
|
user: test
|
|
|
|
date: Thu Jan 01 00:00:00 1970 +0000
|
|
|
|
summary: #1
|
|
|
|
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (1 entities):
|
2014-05-17 00:18:57 +04:00
|
|
|
b
|
|
|
|
|
|
|
|
$ hg -R clone2 outgoing --large --graph --template "{rev}"
|
2014-11-17 00:26:15 +03:00
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
2014-05-17 00:18:57 +04:00
|
|
|
searching for changes
|
|
|
|
@ 1
|
|
|
|
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (1 entities):
|
2014-05-17 00:18:57 +04:00
|
|
|
b
|
|
|
|
|
|
|
|
|
2014-07-07 13:45:46 +04:00
|
|
|
$ cp clone2/b clone2/b1
|
|
|
|
$ cp clone2/b clone2/b2
|
|
|
|
$ hg -R clone2 add --large clone2/b1 clone2/b2
|
|
|
|
$ hg -R clone2 commit -m '#2: add largefiles referring same entity'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A b1
|
|
|
|
A b2
|
|
|
|
$ hg -R clone2 summary --large
|
|
|
|
parent: 2:6095d0695d70 tip
|
|
|
|
#2: add largefiles referring same entity
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 3 draft
|
largefiles: show also how many data entities are outgoing at "hg summary"
Before this patch, "hg summary --large" shows how many largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the number of outgoing largefiles shown in
"hg summary" output, users should expect that the former below costs
much more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
summary" by counting number of unique hash values for outgoing
largefiles.
This patch introduces "_getoutgoings" to centralize the logic
(de-duplication, too) into it for convenience of subsequent patches,
even though it is not required in "hg summary" case.
2014-07-07 13:45:46 +04:00
|
|
|
largefiles: 1 entities for 3 files to upload
|
2014-07-07 13:45:46 +04:00
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
1:1acbe71ce432
|
|
|
|
2:6095d0695d70
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (1 entities):
|
2014-07-07 13:45:46 +04:00
|
|
|
b
|
|
|
|
b1
|
|
|
|
b2
|
|
|
|
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
$ hg -R clone2 cat -r 1 clone2/.hglf/b
|
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
2015-05-10 09:40:40 +03:00
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
query 1; heads
|
|
|
|
searching for changes
|
|
|
|
all remote heads known locally
|
|
|
|
1:1acbe71ce432
|
|
|
|
2:6095d0695d70
|
2016-03-11 17:26:06 +03:00
|
|
|
finding outgoing largefiles: 0/2 revisions (0.00%)
|
|
|
|
finding outgoing largefiles: 1/2 revisions (50.00%)
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (1 entities):
|
|
|
|
b
|
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
|
|
|
b1
|
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
|
|
|
b2
|
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
|
|
|
|
2014-07-07 13:45:46 +04:00
|
|
|
|
|
|
|
$ echo bbb > clone2/b
|
|
|
|
$ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
|
|
|
|
Invoking status precommit hook
|
|
|
|
M b
|
|
|
|
$ echo bbbb > clone2/b
|
|
|
|
$ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
|
|
|
|
Invoking status precommit hook
|
|
|
|
M b
|
|
|
|
$ cp clone2/b1 clone2/b
|
|
|
|
$ hg -R clone2 commit -m '#5: refer existing largefile entity again'
|
|
|
|
Invoking status precommit hook
|
|
|
|
M b
|
|
|
|
$ hg -R clone2 summary --large
|
|
|
|
parent: 5:036794ea641c tip
|
|
|
|
#5: refer existing largefile entity again
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 6 draft
|
largefiles: show also how many data entities are outgoing at "hg summary"
Before this patch, "hg summary --large" shows how many largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the number of outgoing largefiles shown in
"hg summary" output, users should expect that the former below costs
much more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
summary" by counting number of unique hash values for outgoing
largefiles.
This patch introduces "_getoutgoings" to centralize the logic
(de-duplication, too) into it for convenience of subsequent patches,
even though it is not required in "hg summary" case.
2014-07-07 13:45:46 +04:00
|
|
|
largefiles: 3 entities for 3 files to upload
|
2014-07-07 13:45:46 +04:00
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
1:1acbe71ce432
|
|
|
|
2:6095d0695d70
|
|
|
|
3:7983dce246cc
|
|
|
|
4:233f12ada4ae
|
|
|
|
5:036794ea641c
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (3 entities):
|
|
|
|
b
|
|
|
|
b1
|
|
|
|
b2
|
|
|
|
|
|
|
|
$ hg -R clone2 cat -r 3 clone2/.hglf/b
|
|
|
|
c801c9cfe94400963fcb683246217d5db77f9a9a
|
|
|
|
$ hg -R clone2 cat -r 4 clone2/.hglf/b
|
|
|
|
13f9ed0898e315bf59dc2973fec52037b6f441a2
|
2015-05-10 09:40:40 +03:00
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
query 1; heads
|
|
|
|
searching for changes
|
|
|
|
all remote heads known locally
|
|
|
|
1:1acbe71ce432
|
|
|
|
2:6095d0695d70
|
|
|
|
3:7983dce246cc
|
|
|
|
4:233f12ada4ae
|
|
|
|
5:036794ea641c
|
2016-03-11 17:26:06 +03:00
|
|
|
finding outgoing largefiles: 0/5 revisions (0.00%)
|
|
|
|
finding outgoing largefiles: 1/5 revisions (20.00%)
|
|
|
|
finding outgoing largefiles: 2/5 revisions (40.00%)
|
|
|
|
finding outgoing largefiles: 3/5 revisions (60.00%)
|
|
|
|
finding outgoing largefiles: 4/5 revisions (80.00%)
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (3 entities):
|
2014-07-07 13:45:46 +04:00
|
|
|
b
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
13f9ed0898e315bf59dc2973fec52037b6f441a2
|
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
|
|
|
c801c9cfe94400963fcb683246217d5db77f9a9a
|
2014-07-07 13:45:46 +04:00
|
|
|
b1
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
2014-07-07 13:45:46 +04:00
|
|
|
b2
|
largefiles: show also how many data entities are outgoing at "hg outgoing"
Before this patch, "hg outgoing --large" shows which largefiles are
changed or added in outgoing revisions only in the point of the view
of filenames.
For example, according to the list of outgoing largefiles shown in "hg
outgoing" output, users should expect that the former below costs much
more to upload outgoing largefiles than the latter.
- outgoing revisions add a hundred largefiles, but all of them refer
the same data entity
in this case, only one data entity is outgoing, even though "hg
summary" says that a hundred largefiles are outgoing.
- a hundred outgoing revisions change only one largefile with
distinct data
in this case, a hundred data entities are outgoing, even though
"hg summary" says that only one largefile is outgoing.
But the latter costs much more than the former, in fact.
This patch shows also how many data entities are outgoing at "hg
outgoing" by counting number of unique hash values for outgoing
largefiles.
When "--debug" is specified, this patch also shows what entities (in
hash) are outgoing for each largefiles listed up, for debug purpose.
In "ui.debugflag" route, "addfunc()" can append given "lfhash" to the
list "toupload[fn]" always without duplication check, because
de-duplication is already done in "_getoutgoings()".
2014-07-07 13:45:46 +04:00
|
|
|
89e6c98d92887913cadf06b2adb97f26cde4849b
|
2014-07-07 13:45:46 +04:00
|
|
|
|
|
|
|
|
2014-04-18 00:47:38 +04:00
|
|
|
Pushing revision #1 causes uploading entity 89e6c98d9288, which is
|
2014-07-07 13:45:46 +04:00
|
|
|
shared also by largefiles b1, b2 in revision #2 and b in revision #5.
|
|
|
|
|
|
|
|
Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
|
|
|
|
summary" and "hg outgoing", even though files in outgoing revision #2
|
|
|
|
and #5 refer it.
|
|
|
|
|
|
|
|
$ hg -R clone2 push -r 1 -q
|
|
|
|
$ hg -R clone2 summary --large
|
|
|
|
parent: 5:036794ea641c tip
|
|
|
|
#5: refer existing largefile entity again
|
|
|
|
branch: default
|
|
|
|
commit: (clean)
|
|
|
|
update: (current)
|
2015-05-29 23:23:58 +03:00
|
|
|
phases: 6 draft
|
2014-07-07 13:45:46 +04:00
|
|
|
largefiles: 2 entities for 1 files to upload
|
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
|
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
searching for changes
|
|
|
|
2:6095d0695d70
|
|
|
|
3:7983dce246cc
|
|
|
|
4:233f12ada4ae
|
|
|
|
5:036794ea641c
|
|
|
|
largefiles to upload (2 entities):
|
|
|
|
b
|
|
|
|
|
2015-05-10 09:40:40 +03:00
|
|
|
$ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
|
2014-07-07 13:45:46 +04:00
|
|
|
comparing with $TESTTMP/issue3651/src (glob)
|
|
|
|
query 1; heads
|
|
|
|
searching for changes
|
|
|
|
all remote heads known locally
|
|
|
|
2:6095d0695d70
|
|
|
|
3:7983dce246cc
|
|
|
|
4:233f12ada4ae
|
|
|
|
5:036794ea641c
|
2016-03-11 17:26:06 +03:00
|
|
|
finding outgoing largefiles: 0/4 revisions (0.00%)
|
|
|
|
finding outgoing largefiles: 1/4 revisions (25.00%)
|
|
|
|
finding outgoing largefiles: 2/4 revisions (50.00%)
|
|
|
|
finding outgoing largefiles: 3/4 revisions (75.00%)
|
2014-07-07 13:45:46 +04:00
|
|
|
largefiles to upload (2 entities):
|
|
|
|
b
|
|
|
|
13f9ed0898e315bf59dc2973fec52037b6f441a2
|
|
|
|
c801c9cfe94400963fcb683246217d5db77f9a9a
|
|
|
|
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
merge action 'd' for 'local renamed directory to d2/g' which has no filename
|
|
|
|
==================================================================================
|
|
|
|
|
|
|
|
$ hg init merge-action
|
|
|
|
$ cd merge-action
|
|
|
|
$ touch l
|
|
|
|
$ hg add --large l
|
|
|
|
$ mkdir d1
|
|
|
|
$ touch d1/f
|
|
|
|
$ hg ci -Aqm0
|
|
|
|
Invoking status precommit hook
|
|
|
|
A d1/f
|
|
|
|
A l
|
|
|
|
$ echo > d1/f
|
|
|
|
$ touch d1/g
|
|
|
|
$ hg ci -Aqm1
|
|
|
|
Invoking status precommit hook
|
|
|
|
M d1/f
|
|
|
|
A d1/g
|
|
|
|
$ hg up -qr0
|
|
|
|
$ hg mv d1 d2
|
|
|
|
moving d1/f to d2/f (glob)
|
|
|
|
$ hg ci -qm2
|
|
|
|
Invoking status precommit hook
|
|
|
|
A d2/f
|
|
|
|
R d1/f
|
|
|
|
$ hg merge
|
|
|
|
merging d2/f and d1/f to d2/f
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
1 files updated, 1 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
|
|
|
Merge conflicts:
|
|
|
|
=====================
|
|
|
|
|
|
|
|
$ hg init merge
|
|
|
|
$ cd merge
|
|
|
|
$ echo 0 > f-different
|
|
|
|
$ echo 0 > f-same
|
|
|
|
$ echo 0 > f-unchanged-1
|
|
|
|
$ echo 0 > f-unchanged-2
|
|
|
|
$ hg add --large *
|
|
|
|
$ hg ci -m0
|
|
|
|
Invoking status precommit hook
|
|
|
|
A f-different
|
|
|
|
A f-same
|
|
|
|
A f-unchanged-1
|
|
|
|
A f-unchanged-2
|
|
|
|
$ echo tmp1 > f-unchanged-1
|
|
|
|
$ echo tmp1 > f-unchanged-2
|
|
|
|
$ echo tmp1 > f-same
|
|
|
|
$ hg ci -m1
|
|
|
|
Invoking status precommit hook
|
|
|
|
M f-same
|
|
|
|
M f-unchanged-1
|
|
|
|
M f-unchanged-2
|
|
|
|
$ echo 2 > f-different
|
|
|
|
$ echo 0 > f-unchanged-1
|
|
|
|
$ echo 1 > f-unchanged-2
|
|
|
|
$ echo 1 > f-same
|
|
|
|
$ hg ci -m2
|
|
|
|
Invoking status precommit hook
|
|
|
|
M f-different
|
|
|
|
M f-same
|
|
|
|
M f-unchanged-1
|
|
|
|
M f-unchanged-2
|
|
|
|
$ hg up -qr0
|
|
|
|
$ echo tmp2 > f-unchanged-1
|
|
|
|
$ echo tmp2 > f-unchanged-2
|
|
|
|
$ echo tmp2 > f-same
|
|
|
|
$ hg ci -m3
|
|
|
|
Invoking status precommit hook
|
|
|
|
M f-same
|
|
|
|
M f-unchanged-1
|
|
|
|
M f-unchanged-2
|
|
|
|
created new head
|
|
|
|
$ echo 1 > f-different
|
|
|
|
$ echo 1 > f-unchanged-1
|
|
|
|
$ echo 0 > f-unchanged-2
|
|
|
|
$ echo 1 > f-same
|
|
|
|
$ hg ci -m4
|
|
|
|
Invoking status precommit hook
|
|
|
|
M f-different
|
|
|
|
M f-same
|
|
|
|
M f-unchanged-1
|
|
|
|
M f-unchanged-2
|
|
|
|
$ hg merge
|
|
|
|
largefile f-different has a merge conflict
|
|
|
|
ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
|
|
|
|
keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
|
|
|
|
take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
|
|
|
|
getting changed largefiles
|
|
|
|
1 largefiles updated, 0 removed
|
largefiles: update largefiles even if rebase is aborted by conflict
Before this patch, largefiles in the working directory aren't updated
correctly, if rebase is aborted by conflict. This prevents users from
viewing appropriate largefiles while resolving conflicts.
While rebase, largefiles in the working directory are updated only at
successful committing in the special code path of
"lfilesrepo.commit()".
To update largefiles even if rebase is aborted by conflict, this patch
centralizes the logic of updating largefiles in the working directory
into the "mergeupdate" wrapping "merge.update".
This is a temporary way to fix with less changes. For fundamental
resolution of this kind of problems in the future, largefiles in the
working directory should be updated with other (normal) files
simultaneously while "merge.update" execution: maybe by hooking
"applyupdates".
"Action list based updating" introduced by hooking "applyupdates" will
also improve performance of updating, because it automatically
decreases target files to be checked.
Just after this patch, there are some improper things in "Case 0" code
path of "lfilesrepo.commit()":
- "updatelfiles" invocation is redundant for rebase
- detailed comment doesn't meet to rebase behavior
These will be resolved after the subsequent patch for transplant,
because this code path is shared with transplant.
Even though replacing "merge.update" in rebase extension by "hg.merge"
can also avoid this problem, this patch chooses centralizing the logic
into "mergeupdate", because:
- "merge.update" invocation in rebase extension can't be directly
replaced by "hg.merge", because:
- rebase requires some extra arguments, which "hg.merge" doesn't
take (e.g. "ancestor")
- rebase doesn't require statistics information forcibly displayed
in "hg.merge"
- introducing "mergeupdate" can resolve also problem of some other
code paths directly using "merge.update"
largefiles in the working directory aren't updated regardless of
the result of commands below, before this patch:
- backout (for revisions other than the parent revision of the
working directory without "--merge")
- graft
- histedit (for revisions other than the parent of the working
directory
When "partial" is specified, "merge.update" doesn't update dirstate
entries for standins, even though standins themselves are updated.
In this case, "normallookup" should be used to mark largefiles as
"possibly dirty" forcibly, because applying "normal" on lfdirstate
treats them as "clean" unexpectedly.
This is reason why "normallookup=partial" is specified for
"lfcommands.updatelfiles".
This patch doesn't test "hg rebase --continue", because it doesn't
work correctly if largefiles in the working directory are modified
manually while resolving conflicts. This will be fixed in the next
step of refactoring for largefiles.
All changes of tests/*.t files other than test-largefiles-update.t in
this patch come from invoking "updatelfiles" not after but before
statistics output of "hg.update", "hg.clean" and "hg.merge".
2014-08-24 18:47:26 +04:00
|
|
|
0 files updated, 4 files merged, 0 files removed, 0 files unresolved
|
|
|
|
(branch merge, don't forget to commit)
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cat f-different
|
|
|
|
1
|
|
|
|
$ cat f-same
|
|
|
|
1
|
|
|
|
$ cat f-unchanged-1
|
|
|
|
1
|
|
|
|
$ cat f-unchanged-2
|
|
|
|
1
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
Test largefile insulation (do not enabled a side effect
|
|
|
|
========================================================
|
|
|
|
|
|
|
|
Check whether "largefiles" feature is supported only in repositories
|
|
|
|
enabling largefiles extension.
|
|
|
|
|
|
|
|
$ mkdir individualenabling
|
|
|
|
$ cd individualenabling
|
|
|
|
|
|
|
|
$ hg init enabledlocally
|
|
|
|
$ echo large > enabledlocally/large
|
|
|
|
$ hg -R enabledlocally add --large enabledlocally/large
|
|
|
|
$ hg -R enabledlocally commit -m '#0'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A large
|
|
|
|
|
|
|
|
$ hg init notenabledlocally
|
|
|
|
$ echo large > notenabledlocally/large
|
|
|
|
$ hg -R notenabledlocally add --large notenabledlocally/large
|
|
|
|
$ hg -R notenabledlocally commit -m '#0'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A large
|
|
|
|
|
|
|
|
$ cat >> $HGRCPATH <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> # disable globally
|
|
|
|
> largefiles=!
|
|
|
|
> EOF
|
|
|
|
$ cat >> enabledlocally/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> # enable locally
|
|
|
|
> largefiles=
|
|
|
|
> EOF
|
|
|
|
$ hg -R enabledlocally root
|
|
|
|
$TESTTMP/individualenabling/enabledlocally (glob)
|
|
|
|
$ hg -R notenabledlocally root
|
|
|
|
abort: repository requires features unknown to this Mercurial: largefiles!
|
2015-09-30 23:43:49 +03:00
|
|
|
(see https://mercurial-scm.org/wiki/MissingRequirement for more information)
|
2014-05-17 00:18:57 +04:00
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg init push-dst
|
|
|
|
$ hg -R enabledlocally push push-dst
|
|
|
|
pushing to push-dst
|
|
|
|
abort: required features are not supported in the destination: largefiles
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg init pull-src
|
|
|
|
$ hg -R pull-src pull enabledlocally
|
|
|
|
pulling from enabledlocally
|
|
|
|
abort: required features are not supported in the destination: largefiles
|
|
|
|
[255]
|
|
|
|
|
|
|
|
$ hg clone enabledlocally clone-dst
|
|
|
|
abort: repository requires features unknown to this Mercurial: largefiles!
|
2015-09-30 23:43:49 +03:00
|
|
|
(see https://mercurial-scm.org/wiki/MissingRequirement for more information)
|
2014-05-17 00:18:57 +04:00
|
|
|
[255]
|
|
|
|
$ test -d clone-dst
|
|
|
|
[1]
|
|
|
|
$ hg clone --pull enabledlocally clone-pull-dst
|
|
|
|
abort: required features are not supported in the destination: largefiles
|
|
|
|
[255]
|
|
|
|
$ test -d clone-pull-dst
|
|
|
|
[1]
|
|
|
|
|
|
|
|
#if serve
|
|
|
|
|
|
|
|
Test largefiles specific peer setup, when largefiles is enabled
|
|
|
|
locally (issue4109)
|
|
|
|
|
|
|
|
$ hg showconfig extensions | grep largefiles
|
|
|
|
extensions.largefiles=!
|
|
|
|
$ mkdir -p $TESTTMP/individualenabling/usercache
|
|
|
|
|
|
|
|
$ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
|
|
|
|
$ cat hg.pid >> $DAEMON_PIDS
|
|
|
|
|
|
|
|
$ hg init pull-dst
|
|
|
|
$ cat > pull-dst/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> # enable locally
|
|
|
|
> largefiles=
|
|
|
|
> [largefiles]
|
|
|
|
> # ignore system cache to force largefiles specific wire proto access
|
|
|
|
> usercache=$TESTTMP/individualenabling/usercache
|
|
|
|
> EOF
|
|
|
|
$ hg -R pull-dst -q pull -u http://localhost:$HGPORT
|
|
|
|
|
2015-06-08 22:55:40 +03:00
|
|
|
$ killdaemons.py
|
2014-05-17 00:18:57 +04:00
|
|
|
#endif
|
|
|
|
|
largefiles: access to specific fields only if largefiles enabled (issue4547)
Even if largefiles extension is enabled in a repository, "repo"
object, which isn't "largefiles.reposetup()"-ed, is passed to
overridden functions in the cases below unexpectedly, because
extensions are enabled for each repositories strictly.
(1) clone without -U:
(2) pull with -U:
(3) pull with --rebase:
combination of "enabled@src", "disabled@dst" and
"not-required@src" cause this situation.
largefiles requirement
@src @dst @src result
-------- -------- --------------- --------------------
enabled disabled not-required aborted unexpectedly
required requirement error (intentional)
-------- -------- --------------- --------------------
enabled enabled * success
-------- -------- --------------- --------------------
disabled enabled * success (only for "pull")
-------- -------- --------------- --------------------
disabled disabled not-required success
required requirement error (intentional)
-------- -------- --------------- --------------------
(4) update/revert with a subrepo disabling largefiles
In these cases, overridden functions cause accessing to largefiles
specific fields of not "largefiles.reposetup()"-ed "repo" object, and
execution is aborted.
- (1), (2), (4) cause accessing to "_lfstatuswriters" in
"getstatuswriter()" invoked via "updatelfiles()"
- (3) causes accessing to "_lfcommithooks" in "overriderebase()"
For safe accessing to these fields, this patch examines whether passed
"repo" object is "largefiles.reposetup()"-ed or not before accessing
to them.
This patch chooses examining existence of newly introduced
"_largefilesenabled" instead of "_lfcommithooks" and
"_lfstatuswriters" directly, because the former is better name for the
generic "largefiles is enabled in this repo" mark than the latter.
In the future, all other overridden functions should avoid largefiles
specific processing for efficiency, and "_largefilesenabled" is better
also for such purpose.
BTW, "lfstatus" can't be used for such purpose, because some code
paths set it forcibly regardless of existence of it in specified
"repo" object.
2015-02-26 00:03:39 +03:00
|
|
|
Test overridden functions work correctly even for repos disabling
|
|
|
|
largefiles (issue4547)
|
|
|
|
|
|
|
|
$ hg showconfig extensions | grep largefiles
|
|
|
|
extensions.largefiles=!
|
|
|
|
|
|
|
|
(test updating implied by clone)
|
|
|
|
|
|
|
|
$ hg init enabled-but-no-largefiles
|
|
|
|
$ echo normal1 > enabled-but-no-largefiles/normal1
|
|
|
|
$ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1
|
|
|
|
$ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A normal1
|
|
|
|
$ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> # enable locally
|
|
|
|
> largefiles=
|
|
|
|
> EOF
|
|
|
|
$ hg clone -q enabled-but-no-largefiles no-largefiles
|
|
|
|
|
|
|
|
$ echo normal2 > enabled-but-no-largefiles/normal2
|
|
|
|
$ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2
|
|
|
|
$ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A normal2
|
|
|
|
|
|
|
|
$ echo normal3 > no-largefiles/normal3
|
|
|
|
$ hg -R no-largefiles add no-largefiles/normal3
|
|
|
|
$ hg -R no-largefiles commit -m '#1@no-largefiles'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A normal3
|
|
|
|
|
|
|
|
$ hg -R no-largefiles -q pull --rebase
|
|
|
|
Invoking status precommit hook
|
context: write dirstate out explicitly after marking files as clean
To detect change of a file without redundant comparison of file
content, dirstate recognizes a file as certainly clean, if:
(1) it is already known as "normal",
(2) dirstate entry for it has valid (= not "-1") timestamp, and
(3) mode, size and timestamp of it on the filesystem are as same as
ones expected in dirstate
This works as expected in many cases, but doesn't in the corner case
that changing a file keeps mode, size and timestamp of it on the
filesystem.
The timetable below shows steps in one of typical such situations:
---- ----------------------------------- ----------------
timestamp of "f"
----------------
dirstate file-
time action mem file system
---- ----------------------------------- ---- ----- -----
N -1 ***
- make file "f" clean N
- execute 'hg foobar'
- instantiate 'dirstate' -1 -1
- 'dirstate.normal("f")' N -1
(e.g. via dirty check)
- change "f", but keep size N
N+1
- release wlock
- 'dirstate.write()' N N
- 'hg status' shows "f" as "clean" N N N
---- ----------------------------------- ---- ----- -----
The most important point is that 'dirstate.write()' is executed at N+1
or later. This causes writing dirstate timestamp N of "f" out
successfully. If it is executed at N, 'parsers.pack_dirstate()'
replaces timestamp N with "-1" before actual writing dirstate out.
Occasional test failure for unexpected file status is typical example
of this corner case. Batch execution with small working directory is
finished in no time, and rarely satisfies condition (2) above.
This issue can occur in cases below;
- 'hg revert --rev REV' for revisions other than the parent
- failure of 'merge.update()' before 'merge.recordupdates()'
The root cause of this issue is that files are changed without
flushing in-memory dirstate changes via 'repo.commit()' (even though
omitting 'dirstate.normallookup()' on changed files also causes this
issue).
To detect changes of files correctly, this patch writes in-memory
dirstate changes out explicitly after marking files as clean in
'workingctx._checklookup()', which is invoked via 'repo.status()'.
After this change, timetable is changed as below:
---- ----------------------------------- ----------------
timestamp of "f"
----------------
dirstate file-
time action mem file system
---- ----------------------------------- ---- ----- -----
N -1 ***
- make file "f" clean N
- execute 'hg foobar'
- instantiate 'dirstate' -1 -1
- 'dirstate.normal("f")' N -1
(e.g. via dirty check)
----------------------------------- ---- ----- -----
- 'dirsttate.write()' -1 -1
----------------------------------- ---- ----- -----
- change "f", but keep size N
N+1
- release wlock
- 'dirstate.write()' -1 -1
- 'hg status' -1 -1 N
---- ----------------------------------- ---- ----- -----
To reproduce this issue in tests certainly, this patch emulates some
timing critical actions as below:
- timestamp of "f" in '.hg/dirstate' is -1 at the beginning
'hg debugrebuildstate' before command invocation ensures it.
- make file "f" clean at N
- change "f" at N
'touch -t 200001010000' before and after command invocation
changes mtime of "f" to "2000-01-01 00:00" (= N).
- invoke 'dirstate.write()' via 'repo.status()' at N
'fakedirstatewritetime.py' forces 'pack_dirstate()' to use
"2000-01-01 00:00" as "now", only if 'pack_dirstate()' is invoked
via 'workingctx._checklookup()'.
- invoke 'dirstate.write()' via releasing wlock at N+1 (or "not at N")
'pack_dirstate()' via releasing wlock uses actual timestamp at
runtime as "now", and it should be different from the "2000-01-01
00:00" of "f".
BTW, this patch also changes 'test-largefiles-misc.t', because adding
'dirstate.write()' makes recent dirstate changes visible to external
process.
2015-07-08 11:01:09 +03:00
|
|
|
A normal3
|
largefiles: access to specific fields only if largefiles enabled (issue4547)
Even if largefiles extension is enabled in a repository, "repo"
object, which isn't "largefiles.reposetup()"-ed, is passed to
overridden functions in the cases below unexpectedly, because
extensions are enabled for each repositories strictly.
(1) clone without -U:
(2) pull with -U:
(3) pull with --rebase:
combination of "enabled@src", "disabled@dst" and
"not-required@src" cause this situation.
largefiles requirement
@src @dst @src result
-------- -------- --------------- --------------------
enabled disabled not-required aborted unexpectedly
required requirement error (intentional)
-------- -------- --------------- --------------------
enabled enabled * success
-------- -------- --------------- --------------------
disabled enabled * success (only for "pull")
-------- -------- --------------- --------------------
disabled disabled not-required success
required requirement error (intentional)
-------- -------- --------------- --------------------
(4) update/revert with a subrepo disabling largefiles
In these cases, overridden functions cause accessing to largefiles
specific fields of not "largefiles.reposetup()"-ed "repo" object, and
execution is aborted.
- (1), (2), (4) cause accessing to "_lfstatuswriters" in
"getstatuswriter()" invoked via "updatelfiles()"
- (3) causes accessing to "_lfcommithooks" in "overriderebase()"
For safe accessing to these fields, this patch examines whether passed
"repo" object is "largefiles.reposetup()"-ed or not before accessing
to them.
This patch chooses examining existence of newly introduced
"_largefilesenabled" instead of "_lfcommithooks" and
"_lfstatuswriters" directly, because the former is better name for the
generic "largefiles is enabled in this repo" mark than the latter.
In the future, all other overridden functions should avoid largefiles
specific processing for efficiency, and "_largefilesenabled" is better
also for such purpose.
BTW, "lfstatus" can't be used for such purpose, because some code
paths set it forcibly regardless of existence of it in specified
"repo" object.
2015-02-26 00:03:39 +03:00
|
|
|
|
|
|
|
(test reverting)
|
|
|
|
|
|
|
|
$ hg init subrepo-root
|
|
|
|
$ cat >> subrepo-root/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> # enable locally
|
|
|
|
> largefiles=
|
|
|
|
> EOF
|
|
|
|
$ echo large > subrepo-root/large
|
|
|
|
$ hg -R subrepo-root add --large subrepo-root/large
|
|
|
|
$ hg clone -q no-largefiles subrepo-root/no-largefiles
|
|
|
|
$ cat > subrepo-root/.hgsub <<EOF
|
|
|
|
> no-largefiles = no-largefiles
|
|
|
|
> EOF
|
|
|
|
$ hg -R subrepo-root add subrepo-root/.hgsub
|
|
|
|
$ hg -R subrepo-root commit -m '#0'
|
|
|
|
Invoking status precommit hook
|
|
|
|
A .hgsub
|
|
|
|
A large
|
|
|
|
? .hgsubstate
|
|
|
|
$ echo dirty >> subrepo-root/large
|
|
|
|
$ echo dirty >> subrepo-root/no-largefiles/normal1
|
|
|
|
$ hg -R subrepo-root status -S
|
|
|
|
M large
|
|
|
|
M no-largefiles/normal1
|
|
|
|
$ hg -R subrepo-root revert --all
|
|
|
|
reverting subrepo-root/.hglf/large (glob)
|
|
|
|
reverting subrepo no-largefiles
|
|
|
|
reverting subrepo-root/no-largefiles/normal1 (glob)
|
|
|
|
|
2014-05-17 00:18:57 +04:00
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
|
largefiles: remove meaningless code path for "hg pull --rebase"
This patch removes "--rebase" specific code path for "hg pull" in
"overridepull", because previous patch makes it meaningless: now,
"rebase.rebase" ("orig" invocation in this patch) can
update/commit largefiles safely without "repo._isrebasing = True".
As a side effect of removing "rebase.rebase" invocation in
"overridepull", this patch removes "nothing to rebase ..." message in
"test-largefiles.t", which is shown only when rebase extension is
enabled AFTER largefiles:
before this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull" at
first, because rebase wraps "hg pull" later
2. "pullrebase" invokes "overridepull" of largefiles as "orig",
even though rebase assumes that "orig" is "pull" of commands
3. "overridepull" executes "pull" and "rebase" directly
3.1 "pull" pulls changesets and creates new head "X"
3.2 "rebase" rebases current working parent "Y" on "X"
4. "overridepull" returns to "pullrebase"
5. "pullrebase" tries to rebase, but there is nothing to be done,
because "Y" is already rebased on "X". then, it shows "nothing
to rebase ..."
after this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull"
2. "pullrebase" invokes "overridepull" of largefiles as "orig"
3. "overridepull" executes "pull" as "orig"
4. "overridepull" returns to "pullrebase"
5. revision "Y" is not yet rebased, so "pullrebase" doesn't shows
"nothing to rebase ..."
As another side effect of removing "rebase.rebase" invocation, this
patch fixes issue3861, which occurs only when rebase extension is
enabled BEFORE largefiles:
before this patch:
1. "dispatch" invokes "overridepull" of largefiles at first,
because largefiles wrap "hg pull" later
2. "overridepull" executes "pull" and "rebase" explicitly
2.1 "pull" pulls changesets and creates new head "X"
2.2 "rebase" rebases current working parent, but fails because
no revision is checked out in issue3861 case
3. "overridepull" returns to "dispatch" with exit code 1 returned
from "rebase" at (2.2)
4. "hg pull" terminates with exit code 1 unexpectedly
after this patch:
1. "dispatch" invokes "overridepull" of largefiles at first
2. "overridepull" invokes "pullrebase" of rebase as "orig"
3. "pullrebase" invokes "pull" as "orig"
4. "pullrebase" invokes "rebase", and it fails
5. "pullrebase" returns to "overridepull" with exit code 0
(because "pullrebase" ignores result of "pull" and "rebase")
6. "overridepull" returns to "dispatch" with exit code 0 returned
from "rebase" at (5)
7. "hg pull" terminates with exit code 0
2014-11-05 17:24:47 +03:00
|
|
|
Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
|
|
|
|
=========================================================================
|
|
|
|
|
|
|
|
$ hg showconfig extensions | grep largefiles
|
|
|
|
extensions.largefiles=!
|
|
|
|
|
|
|
|
$ mkdir issue3861
|
|
|
|
$ cd issue3861
|
|
|
|
$ hg init src
|
|
|
|
$ hg clone -q src dst
|
|
|
|
$ echo a > src/a
|
|
|
|
$ hg -R src commit -Aqm "#0"
|
|
|
|
Invoking status precommit hook
|
|
|
|
A a
|
|
|
|
|
|
|
|
$ cat >> dst/.hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> largefiles=
|
|
|
|
> EOF
|
|
|
|
$ hg -R dst pull --rebase
|
|
|
|
pulling from $TESTTMP/issue3861/src (glob)
|
|
|
|
requesting all changes
|
|
|
|
adding changesets
|
|
|
|
adding manifests
|
|
|
|
adding file changes
|
|
|
|
added 1 changesets with 1 changes to 1 files
|
2016-02-14 16:25:59 +03:00
|
|
|
nothing to rebase - updating instead
|
largefiles: remove meaningless code path for "hg pull --rebase"
This patch removes "--rebase" specific code path for "hg pull" in
"overridepull", because previous patch makes it meaningless: now,
"rebase.rebase" ("orig" invocation in this patch) can
update/commit largefiles safely without "repo._isrebasing = True".
As a side effect of removing "rebase.rebase" invocation in
"overridepull", this patch removes "nothing to rebase ..." message in
"test-largefiles.t", which is shown only when rebase extension is
enabled AFTER largefiles:
before this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull" at
first, because rebase wraps "hg pull" later
2. "pullrebase" invokes "overridepull" of largefiles as "orig",
even though rebase assumes that "orig" is "pull" of commands
3. "overridepull" executes "pull" and "rebase" directly
3.1 "pull" pulls changesets and creates new head "X"
3.2 "rebase" rebases current working parent "Y" on "X"
4. "overridepull" returns to "pullrebase"
5. "pullrebase" tries to rebase, but there is nothing to be done,
because "Y" is already rebased on "X". then, it shows "nothing
to rebase ..."
after this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull"
2. "pullrebase" invokes "overridepull" of largefiles as "orig"
3. "overridepull" executes "pull" as "orig"
4. "overridepull" returns to "pullrebase"
5. revision "Y" is not yet rebased, so "pullrebase" doesn't shows
"nothing to rebase ..."
As another side effect of removing "rebase.rebase" invocation, this
patch fixes issue3861, which occurs only when rebase extension is
enabled BEFORE largefiles:
before this patch:
1. "dispatch" invokes "overridepull" of largefiles at first,
because largefiles wrap "hg pull" later
2. "overridepull" executes "pull" and "rebase" explicitly
2.1 "pull" pulls changesets and creates new head "X"
2.2 "rebase" rebases current working parent, but fails because
no revision is checked out in issue3861 case
3. "overridepull" returns to "dispatch" with exit code 1 returned
from "rebase" at (2.2)
4. "hg pull" terminates with exit code 1 unexpectedly
after this patch:
1. "dispatch" invokes "overridepull" of largefiles at first
2. "overridepull" invokes "pullrebase" of rebase as "orig"
3. "pullrebase" invokes "pull" as "orig"
4. "pullrebase" invokes "rebase", and it fails
5. "pullrebase" returns to "overridepull" with exit code 0
(because "pullrebase" ignores result of "pull" and "rebase")
6. "overridepull" returns to "dispatch" with exit code 0 returned
from "rebase" at (5)
7. "hg pull" terminates with exit code 0
2014-11-05 17:24:47 +03:00
|
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2014-05-17 00:18:57 +04:00
|
|
|
|
largefiles: remove meaningless code path for "hg pull --rebase"
This patch removes "--rebase" specific code path for "hg pull" in
"overridepull", because previous patch makes it meaningless: now,
"rebase.rebase" ("orig" invocation in this patch) can
update/commit largefiles safely without "repo._isrebasing = True".
As a side effect of removing "rebase.rebase" invocation in
"overridepull", this patch removes "nothing to rebase ..." message in
"test-largefiles.t", which is shown only when rebase extension is
enabled AFTER largefiles:
before this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull" at
first, because rebase wraps "hg pull" later
2. "pullrebase" invokes "overridepull" of largefiles as "orig",
even though rebase assumes that "orig" is "pull" of commands
3. "overridepull" executes "pull" and "rebase" directly
3.1 "pull" pulls changesets and creates new head "X"
3.2 "rebase" rebases current working parent "Y" on "X"
4. "overridepull" returns to "pullrebase"
5. "pullrebase" tries to rebase, but there is nothing to be done,
because "Y" is already rebased on "X". then, it shows "nothing
to rebase ..."
after this patch:
1. "dispatch" invokes "pullrebase" of rebase as "hg pull"
2. "pullrebase" invokes "overridepull" of largefiles as "orig"
3. "overridepull" executes "pull" as "orig"
4. "overridepull" returns to "pullrebase"
5. revision "Y" is not yet rebased, so "pullrebase" doesn't shows
"nothing to rebase ..."
As another side effect of removing "rebase.rebase" invocation, this
patch fixes issue3861, which occurs only when rebase extension is
enabled BEFORE largefiles:
before this patch:
1. "dispatch" invokes "overridepull" of largefiles at first,
because largefiles wrap "hg pull" later
2. "overridepull" executes "pull" and "rebase" explicitly
2.1 "pull" pulls changesets and creates new head "X"
2.2 "rebase" rebases current working parent, but fails because
no revision is checked out in issue3861 case
3. "overridepull" returns to "dispatch" with exit code 1 returned
from "rebase" at (2.2)
4. "hg pull" terminates with exit code 1 unexpectedly
after this patch:
1. "dispatch" invokes "overridepull" of largefiles at first
2. "overridepull" invokes "pullrebase" of rebase as "orig"
3. "pullrebase" invokes "pull" as "orig"
4. "pullrebase" invokes "rebase", and it fails
5. "pullrebase" returns to "overridepull" with exit code 0
(because "pullrebase" ignores result of "pull" and "rebase")
6. "overridepull" returns to "dispatch" with exit code 0 returned
from "rebase" at (5)
7. "hg pull" terminates with exit code 0
2014-11-05 17:24:47 +03:00
|
|
|
$ cd ..
|