Snapd errors out on refreshing to current revision

When you ask snapd to refresh a snap to a revision you’re already on, it unhelpfully tries to perform this change and fails:

 snap list
Name       Version    Rev   Developer       Notes
core       16-2.26.9  2381  canonical       -
project    1.0.0      13    saviq           -
 snap refresh project --edge
snap "project" has no updates available
 snap refresh project --revision 13

error: cannot perform the following tasks:
- Copy snap "project" data (cannot copy "/home/ubuntu/snap/project/13" to "/home/ubuntu/snap/project/13": failed to copy all: "cp: cannot stat '/home/ubuntu/snap/project/13': No such file or directory" (1))
 snap changes
ID   Status  Spawn                 Ready                 Summary
[...]
705  Error   2017-07-19T08:34:23Z  2017-07-19T08:34:25Z  Refresh "project" snap

 snap version
snap    2.26.9
snapd   2.26.9
series  16
ubuntu  17.04
kernel  4.10.0-28-generic

@chipaca I was asked to mention this to you :slight_smile:

hmm, i thought we’d fixed this one, but it looks like no.

It’s rather nasty because in failing it also fails to restore the trash. I’ll have to dig.