2013-10-03 03:21:48 +04:00
|
|
|
$ . "$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-03 03:21:48 +04:00
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
|
|
|
|
# commit a new version of x so we can gc the old one
|
|
|
|
|
|
|
|
$ cd master
|
|
|
|
$ echo y > x
|
|
|
|
$ hg commit -qAm y
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ cd shallow
|
|
|
|
$ hg pull -q
|
|
|
|
$ hg update -q
|
|
|
|
1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
# gc client cache
|
|
|
|
|
2015-07-16 19:06:37 +03:00
|
|
|
$ lastweek=`python -c 'import datetime,time; print datetime.datetime.fromtimestamp(time.time() - (86400 * 7)).strftime("%y%m%d%H%M")'`
|
|
|
|
$ find $CACHEDIR -type f -exec touch -t $lastweek {} \;
|
2013-10-03 03:21:48 +04:00
|
|
|
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2016-04-26 23:00:31 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0 (glob)
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob)
|
|
|
|
$TESTTMP/hgcache/repos (glob)
|
2013-10-03 03:21:48 +04:00
|
|
|
$ hg gc
|
|
|
|
finished: removed 1 of 2 files (0.00 GB to 0.00 GB)
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find $CACHEDIR -type f | sort
|
2016-04-26 23:00:31 +03:00
|
|
|
$TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob)
|
2016-05-18 17:22:10 +03:00
|
|
|
$TESTTMP/hgcache/repos
|
2013-10-03 03:21:48 +04:00
|
|
|
|
|
|
|
# gc server cache
|
|
|
|
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find master/.hg/remotefilelogcache -type f | sort
|
2016-04-26 23:00:31 +03:00
|
|
|
master/.hg/remotefilelogcache/x/1406e74118627694268417491f018a4a883152f0 (glob)
|
2016-05-18 17:22:10 +03:00
|
|
|
master/.hg/remotefilelogcache/x/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob)
|
2013-10-03 03:21:48 +04:00
|
|
|
$ hg gc master
|
|
|
|
finished: removed 0 of 1 files (0.00 GB to 0.00 GB)
|
2016-05-18 17:22:10 +03:00
|
|
|
$ find master/.hg/remotefilelogcache -type f | sort
|
2016-04-26 23:00:31 +03:00
|
|
|
master/.hg/remotefilelogcache/x/48023ec064c1d522f0d792a5a912bb1bf7859a4a (glob)
|
2015-12-02 21:40:49 +03:00
|
|
|
|
|
|
|
$ cp $CACHEDIR/repos $CACHEDIR/repos.bak
|
|
|
|
$ echo " " > $CACHEDIR/repos
|
|
|
|
$ hg gc
|
|
|
|
warning: no valid repos in repofile
|
|
|
|
$ mv $CACHEDIR/repos.bak $CACHEDIR/repos
|
|
|
|
|
|
|
|
|
2015-12-10 03:55:05 +03:00
|
|
|
$ printf "asdas\0das" >> $CACHEDIR/repos
|
2015-12-29 23:47:57 +03:00
|
|
|
$ hg gc 2>&1 | head -n2
|
2015-12-10 03:55:05 +03:00
|
|
|
warning: malformed path: * (glob)
|
2015-12-02 21:40:49 +03:00
|
|
|
Traceback (most recent call last):
|