dvc
dvc copied to clipboard
`update`: `--to-remote` doesn't update deps or delete existing output in workspace
Bug Report
Description
On dvc update --to-remote, the deps section isn't updated, and the old output remains in the workspace.
Reproduce
Repro script:
mkdir update-to-remote
mkdir dvcremote
cd update-to-remote
git init
dvc init -q
dvc remote add -d default ../dvcremote
git add .
git commit --quiet -m "init"
echo foo >> foo
dvc import-url foo bar
cat bar.dvc
echo foo >> foo
dvc update --to-remote bar.dvc
cat bar.dvc
cat bar
Output:
Initialized empty Git repository in /private/tmp/update-to-remote/.git/
Setting 'default' as a default remote.
md5: 39ca7b15b6bb0a11af2c2089cfce7393
frozen: true
deps:
- md5: d3b07384d113edec49eaa6238ad5ff00
size: 4
path: foo
outs:
- md5: d3b07384d113edec49eaa6238ad5ff00
size: 4
path: bar
md5: 39ca7b15b6bb0a11af2c2089cfce7393
frozen: true
deps:
- md5: d3b07384d113edec49eaa6238ad5ff00
size: 4
path: foo
outs:
- md5: 5fb7ba7e8447a836e774b66155f5776a
size: 8
path: bar
foo
Expected
Expected output should have matching md5 and size for deps and outs, and bar should no longer exist in the workspace.
Environment information
$ dvc doctor
DVC version: 2.20.0
---------------------------------
Platform: Python 3.8.5 on macOS-10.16-x86_64-i386-64bit
Supports:
azure (adlfs = 2022.2.0, knack = 0.7.2, azure-identity = 1.5.0),
gdrive (pydrive2 = 1.14.0),
gs (gcsfs = 2022.7.1),
hdfs (fsspec = 2022.7.1, pyarrow = 3.0.0),
http (aiohttp = 3.7.3, aiohttp-retry = 2.8.3),
https (aiohttp = 3.7.3, aiohttp-retry = 2.8.3),
oss (ossfs = 2021.8.0),
s3 (s3fs = 2022.7.1, boto3 = 1.21.21),
ssh (sshfs = 2022.6.0),
webdav (webdav4 = 0.9.4),
webdavs (webdav4 = 0.9.4),
webhdfs (fsspec = 2022.7.1)