2013-10-04 02:15:15 +04:00
|
|
|
# Tests for the complicated linknode logic in remotefilelog.py::ancestormap()
|
|
|
|
|
|
|
|
$ . "$TESTDIR/library.sh"
|
|
|
|
|
|
|
|
$ hginit master
|
|
|
|
$ cd master
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
|
|
|
> server=True
|
|
|
|
> serverexpiration=-1
|
|
|
|
> EOF
|
|
|
|
$ echo x > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ cd ..
|
|
|
|
|
2013-11-23 01:39:35 +04:00
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
2013-10-04 02:15:15 +04:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
|
|
|
|
|
|
|
|
# Rebase produces correct log -f linknodes
|
|
|
|
|
|
|
|
$ cd shallow
|
|
|
|
$ echo y > y
|
|
|
|
$ hg commit -qAm y
|
|
|
|
$ hg up 0
|
|
|
|
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -qAm xx
|
|
|
|
$ hg log -f x --template "{node|short}\n"
|
|
|
|
0632994590a8
|
|
|
|
b292c1e3311f
|
|
|
|
|
|
|
|
$ hg rebase -d 1
|
2014-12-29 22:20:43 +03:00
|
|
|
rebasing 2:0632994590a8 "xx" (tip)
|
2015-01-30 00:35:35 +03:00
|
|
|
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/0632994590a8-0bc786d8-backup.hg (glob)
|
2013-10-04 02:15:15 +04:00
|
|
|
$ hg log -f x --template "{node|short}\n"
|
|
|
|
81deab2073bc
|
|
|
|
b292c1e3311f
|
|
|
|
|
|
|
|
|
|
|
|
# Rebase back, log -f still works
|
|
|
|
|
|
|
|
$ hg rebase -d 0 -r 2
|
2014-12-29 22:20:43 +03:00
|
|
|
rebasing 2:81deab2073bc "xx" (tip)
|
2015-01-30 00:35:35 +03:00
|
|
|
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/81deab2073bc-80cb4fda-backup.hg (glob)
|
2013-10-04 02:15:15 +04:00
|
|
|
$ hg log -f x --template "{node|short}\n"
|
|
|
|
b3fca10fb42d
|
|
|
|
b292c1e3311f
|
|
|
|
|
|
|
|
$ hg rebase -d 1 -r 2
|
2014-12-29 22:20:43 +03:00
|
|
|
rebasing 2:b3fca10fb42d "xx" (tip)
|
2015-01-30 00:35:35 +03:00
|
|
|
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/b3fca10fb42d-da73a0c7-backup.hg (glob)
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
$ cd ..
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
# Reset repos
|
|
|
|
$ clearcache
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
$ rm -rf master
|
|
|
|
$ rm -rf shallow
|
|
|
|
$ hginit master
|
|
|
|
$ cd master
|
|
|
|
$ cat >> .hg/hgrc <<EOF
|
|
|
|
> [remotefilelog]
|
|
|
|
> server=True
|
|
|
|
> serverexpiration=-1
|
|
|
|
> EOF
|
|
|
|
$ echo x > x
|
|
|
|
$ hg commit -qAm x
|
|
|
|
$ cd ..
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-11-23 01:39:35 +04:00
|
|
|
$ hgcloneshallow ssh://user@dummy/master shallow -q
|
2013-10-04 02:15:15 +04:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
# Rebase stack onto landed commit
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
$ cd master
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -Aqm xx
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
$ cd ../shallow
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -Aqm xx2
|
|
|
|
$ echo y >> x
|
|
|
|
$ hg commit -Aqm xxy
|
2013-10-04 02:15:15 +04:00
|
|
|
|
2013-10-05 01:40:47 +04:00
|
|
|
$ hg pull -q
|
|
|
|
$ hg rebase -d tip
|
2014-12-29 22:20:43 +03:00
|
|
|
rebasing 1:4549721d828f "xx2"
|
|
|
|
note: rebase of 1:4549721d828f created no changes to commit
|
|
|
|
rebasing 2:5ef6d97e851c "xxy"
|
2015-01-30 00:35:35 +03:00
|
|
|
saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/4549721d828f-b084e33c-backup.hg (glob)
|
2013-10-05 01:40:47 +04:00
|
|
|
$ hg log -f x --template '{node|short}\n'
|
|
|
|
4ae8e31c85ef
|
|
|
|
0632994590a8
|
|
|
|
b292c1e3311f
|
2013-11-23 01:41:54 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
# system cache has invalid linknode, but .hg/store/data has valid
|
|
|
|
|
|
|
|
$ cd shallow
|
|
|
|
$ hg strip -r 1 -q
|
|
|
|
$ rm -rf .hg/store/data/*
|
|
|
|
$ echo x >> x
|
|
|
|
$ hg commit -Aqm xx_local
|
|
|
|
$ hg log -f x --template '{rev}:{node|short}\n'
|
|
|
|
1:21847713771d
|
|
|
|
0:b292c1e3311f
|
|
|
|
|
|
|
|
$ cd ..
|