Dvc: `dvc move` fails to move datafile to a directory, when the tracking file has a different name than data file

Created on 9 Sep 2019  路  2Comments  路  Source: iterative/dvc

I was playing with dvc move and I got this problem.

Script to reproduce it:

#!/bin/bash -x

rm -rf test1
mkdir test1
cd test1/

echo 'test 1' > file1.txt
dvc init --no-scm
dvc add file1.txt
mv file1.txt.dvc file1.dvc
dvc status
tree -a

mkdir dir1
dvc move file1.txt dir1
dvc status
tree -a
# file1.txt has not been moved to dir1/

I am not sure if this is a glitch or everything is as expected, since the .dvc file has a different name from the datafile. When tracking file and data file have the same name everything works fine.

bug

Most helpful comment

AFAIK file1.txt should be moved. Ill invesitgate.

All 2 comments

AFAIK file1.txt should be moved. Ill invesitgate.

A workaround for this (in the context of the example above) would be:

mv file1.txt dir1/
rm file1.dvc
dvc add -f file1.dvc dir1/file1.txt

or this:

mv file1.txt dir1/
# edit file1.dvc and change: 'path: dir1/file1.txt'
dvc commit file1.dvc
Was this page helpful?
0 / 5 - 0 ratings

Related issues

shcheklein picture shcheklein  路  3Comments

shcheklein picture shcheklein  路  3Comments

tc-ying picture tc-ying  路  3Comments

analystanand picture analystanand  路  3Comments

TezRomacH picture TezRomacH  路  3Comments