Mercurial > hg
annotate tests/library-infinitepush.sh @ 45587:768412472663
merge: store cases when a file is absent post merge in commitinfo
Some merges can result in file being absent form working directory. This can be
one of file was kept deleted or file was removed by merge code.
User might revert the file back before committing. In such cases we will like to
have better handling and create new filenodes.
We store this info in mergestate as commitinfo so that we can use it while
committing to create new filenode if required.
Differential Revision: https://phab.mercurial-scm.org/D9003
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 24 Aug 2020 15:35:34 +0530 |
parents | 03ff17a4bf53 |
children | 0826d684a1b5 |
rev | line source |
---|---|
37187
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
1 scratchnodes() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
2 for node in `find ../repo/.hg/scratchbranches/index/nodemap/* | sort`; do |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
3 echo ${node##*/} `cat $node` |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
4 done |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
5 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
6 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
7 scratchbookmarks() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
8 for bookmark in `find ../repo/.hg/scratchbranches/index/bookmarkmap/* -type f | sort`; do |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
9 echo "${bookmark##*/bookmarkmap/} `cat $bookmark`" |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
10 done |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
11 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
12 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
13 setupcommon() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
14 cat >> $HGRCPATH << EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
15 [extensions] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
16 infinitepush= |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
17 [ui] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
18 ssh = python "$TESTDIR/dummyssh" |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
19 [infinitepush] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
20 branchpattern=re:scratch/.* |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
21 EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
22 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
23 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
24 setupserver() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
25 cat >> .hg/hgrc << EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
26 [infinitepush] |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
27 server=yes |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
28 indextype=disk |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
29 storetype=disk |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
30 reponame=babar |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
31 EOF |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
32 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
33 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
34 waitbgbackup() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
35 sleep 1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
36 hg debugwaitbackup |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
37 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
38 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
39 mkcommitautobackup() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
40 echo $1 > $1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
41 hg add $1 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
42 hg ci -m $1 --config infinitepushbackup.autobackup=True |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
43 } |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
44 |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
45 setuplogdir() { |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
46 mkdir $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
47 chmod 0755 $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
48 chmod +t $TESTTMP/logs |
03ff17a4bf53
infinitepush: move the extension to core from fb-hgext
Pulkit Goyal <7895pulkit@gmail.com>
parents:
diff
changeset
|
49 } |