How can I stop upload from failing on a delete / missing files

Asked by jrgns

I removed some files from my tree using bzr remove

I then called bzr upload, which failed at some point on a tmp file that's not part of my tree. Now when I try to run upload, it tries to delete the files it previously deleted, and fails.

How can I either reset bzr upload, or tell it not to fail on delete?

Question information

English Edit question
bzr Upload plugin Edit question
No assignee Edit question
Solved by:
Vincent Ladeuil
Last query:
Last reply:
Revision history for this message
Best Vincent Ladeuil (vila) said :

I can't really understand what happened from your description only (did you delete files from your remote tree (bad idea) or both from your remote and local trees (why ?).

It would help if you could file a bug with a scenario reproducing it or at a minimum, the .bzr.log file when bzr upload fails (use bzr version to find your .bzr.log file).

Otherwise, doing 'bzr upload --full' should ignore any previous uploads and solve your problem at the price of uploading your whole working tree.

As a general rule, if you modify your remote tree, you break the mechanism used by the plugin to symchronize your trees, so expect failures.

Revision history for this message
jrgns (jurgens.du.toit) said :

I needed to remove a folder from my branch, and did the following

bzr remove icons/

And then I wanted the webserver to reflect the changes:

bzr commit -m "Removed icons folder"
bzr upload

Upload then proceeded to delete the files, but then wanted to delete a file which wasn't on the remote or local system, not because I removed it, but because it was a temp file probably created by upload.

Subsequent calls of upload obviously failed because of the missing files on the remote system.

I reported the bug here:

I did a full upload to fix it, thanx :)

Revision history for this message
Kevin Kaland (kkaland) said :

Hi there,

I've had this problem a couple times; I think the following use case is very common, and it'd be nice if we could work around it in bzr upload:

1. You create a working tree and add pretty much everything. Maybe you're a bzr newbie or whatever.
2. You realize your working tree is big. Like, geez, it's big! You don't really need to version control all those images, for example.
3. You do a bzr remove --keep to get them out of the working tree but keep them such that, you know, your site won't break or anything.
4. You ignore new files with a bzr ignore or editing the .bzrignore file.
5. You commit your changes.

You already know bzr upload is going to try to delete your images, so you copy them to another folder...but then it fails because it's also trying to invariably remove entire folders.

My suggestion is to either:
1. Have bzr upload understand when a bzr remove --keep has been done, if it's possible,
2. Have its own --keep option or --keep-ignored or something, which won't delete files that are in the ignore list.

What do you think? A full upload is pretty painful for some of us uploading to a slow or slow-ish server, especially with the slowness of SSH upload sometimes. It took me all night to do a full upload of this repo the first time :/

Thanks! And let me know if I need to split into a new bug or feature or something. I'm kind of green on using Launchpad.

Revision history for this message
Vincent Ladeuil (vila) said :

@Kevin: Sorry for the delay, the last version of the plugin supports a '.bzrignore-upload' file that should address your need.