sapling/eden/scm/tests/test-remotefilelog-undesired-file-logging.t
Michael Bolin ba00990cdc rename update to goto in hints/messages/etc.
Summary:
Created this diff by running:

```
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#update --clean#goto --clean#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#update --clean#goto --clean#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#update --continue#goto --continue#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#update --continue#goto --continue#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#prog@ update#prog@ goto#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# hg update # hg goto #g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#hg update -C#hg goto -C#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# hg update$# hg goto#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's# update HASH# goto HASH#g'
find eden/scm/tests -name \*.t | xargs sed -i -e 's#hg update 1#hg goto 1#g'
find eden/scm/tests -name \*.t | xargs sed -i -e "s#'hg update'#'hg goto'#g"
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#:prog:`update`#:prog:`goto`#g'
find eden/scm/edenscm -name \*.py | xargs sed -i -e 's#:prog:`update .::`#:prog:`goto .::`#g'
sed -i -e 's#commit or update#commit or goto#' eden/integration/hg/update_test.py
arc f
```

Though then I had to manually update `eden/integration/hg/update_test.py`
to use `assertRegex()` instead of `assertEqual()`, but as noted,
that is a temporary issue due to how we run that
test for EdenFS for Windows internally.

Fixes https://github.com/facebook/sapling/issues/149
Fixes https://github.com/facebook/sapling/issues/293

Reviewed By: zzl0, yancouto

Differential Revision: D41859668

fbshipit-source-id: 3bdf4e342fc1a751335960a3216651a5ce35225f
2022-12-09 13:16:27 -08:00

54 lines
1.5 KiB
Raku

#chg-compatible
$ setconfig workingcopy.ruststatus=False
$ setconfig experimental.allowfilepeer=True
$ . "$TESTDIR/library.sh"
$ cat >> "$TESTTMP/uilog.py" <<EOF
> from edenscm import extensions
> from edenscm import ui as uimod
> def uisetup(ui):
> extensions.wrapfunction(uimod.ui, 'log', mylog)
> def mylog(orig, self, service, *msg, **opts):
> if service in ['undesired_file_fetches']:
> kw = []
> for k, v in sorted(opts.items()):
> kw.append("%s=%s" % (k, v))
> kwstr = ", ".join(kw)
> msgstr = msg[0] % msg[1:]
> self.warn('%s: %s (%s)\n' % (service, msgstr, kwstr))
> return orig(self, service, *msg, **opts)
> EOF
$ cat >> "$HGRCPATH" <<EOF
> [extensions]
> uilog=$TESTTMP/uilog.py
> EOF
$ newserver master
$ clone master client1
$ cd client1
$ echo x > x
$ hg commit -qAm x
$ mkdir dir
$ echo y > dir/y
$ hg commit -qAm y
$ hg push -r tip --to master --create
pushing rev 79c51fb96423 to destination ssh://user@dummy/master bookmark master
searching for changes
exporting bookmark master
remote: adding changesets (?)
remote: adding manifests (?)
remote: adding file changes (?)
$ cd ..
$ clone master shallow --noupdate
$ cd shallow
$ setconfig scmstore.contentstorefallback=True
$ hg goto -q master --config remotefilelog.undesiredfileregex=".*" 2>&1 | sort
1 trees fetched over 0.00s
1 trees fetched over 0.00s
fetching tree '' 05bd2758dd7a25912490d0633b8975bf52bfab06
fetching tree 'dir' 8a87e5128a9877c501d5a20c32dbd2103a54afad