#11111·dvc

`pull` checks out the previous version after `update --no-download` moves an import's `rev_lock` (`.dvc/cache/fs` is not keyed by revision)

Author: greg-lackeyCreated Sep 30, 2026Updated Sep 30, 2026

Bug Report

Description

If a --no-download import has been pulled once, and dvc update --no-download then moves its rev_lock to a newer commit of the source repo, the next dvc pull checks out the old version's data. pull reports success, and the pointer names the new commit while the workspace holds the old data. dvc status then shows modified.

It looks like DVC's file cache for hash-less imports, .dvc/cache/fs/<protocol>/<token>, isn't keyed by the source revision. The token (in dvc/repo/index.py::_load_storage_from_import) comes from tokenize(dep.fs_path, meta_token), and neither depends on rev_lock. So after the pin moves, the storage map finds the previous revision's copy under the same path and uses it without resolving the new revision.

Reproduce

Everything local, with the source repo's remote reachable throughout:

bash
# source repo: one tracked directory, two commits with different content
mkdir -p src/data && cd src
git init -q -b main && dvc init -q
dvc remote add -q -d storage ../storage
echo "v1" > data/file.txt && dvc add -q data && dvc push -q
git add -A && git commit -qm v1 && V1=$(git rev-parse HEAD)
echo "v2" > data/file.txt && dvc add -q data && dvc push -q
git commit -qam v2
cd ..

# consumer repo
mkdir proj && cd proj
git init -q && dvc init -q && git commit -qm init
dvc import -q --no-download --rev "$V1" ../src data -o data
dvc pull -q data.dvc
cat data/file.txt                                  # v1

dvc update -q --no-download --rev main data.dvc    # rev_lock now points at the v2 commit
dvc pull -q data.dvc
cat data/file.txt                                  # v1   <-- expected v2
dvc status                                         # data.dvc: changed outs: modified: data
ls .dvc/cache/fs/*/*/                              # file.txt, the v1 copy

Deleting .dvc/cache/fs before the second pull gives v2, as expected.

Expected

After update --no-download moves rev_lock, dvc pull resolves the new revision and checks out v2.

What does and doesn't trigger it

  • Triggered: import --no-download → pull (this fills .dvc/cache/fs) → update --no-download → pull.
  • Not triggered: a plain dvc update (with download) gives v2. A normal dvc import followed by update --no-download + pull also gives v2, because the import recorded an output hash, so .dvc/cache/fs was never filled.

A side note, in case it's useful: after a successful pull and dvc commit, .dvc/cache/fs still holds a full second copy of the imported data.

Possible fix

Include the dependency's revision (rev_lock) in the .dvc/cache/fs token for repo imports, or invalidate that cache entry when update changes rev_lock.

Environment information

DVC version: 3.67.1 (pip)

Platform: Python 3.11.16 on macOS-26.5-arm64-arm-64bit Subprojects: dvc_data = 3.18.3 dvc_objects = 5.2.0 dvc_render = 1.0.2 dvc_task = 0.40.2 scmrepo = 3.6.2 Supports: http (aiohttp = 3.14.3, aiohttp-retry = 2.9.1), https (aiohttp = 3.14.3, aiohttp-retry = 2.9.1) Config: Global: /Users//Library/Application Support/dvc System: /Library/Application Support/dvc