Can Bazaar ignore versioned modified files?

Asked by Laszlo Pandy

There are some files which we would like to have in our repository, but must be changed by every user to suit their current environment.
For example, a source file which contains the database name and password, or a project file for an IDE which contains paths specific to that user's environment. Currently if we keep these files in the repository each user must keep a modified version in their working copy, and instead of being able to do "bzr commit" they have to specifically list all the paths to make sure modifications specific to their environment aren't included in the diff.

I would like to know if bzr (or any other VCS for that matter) has the ability to set ignore on versioned files, like "bzr ignore" which works on unversioned files, so that files which are already tracked by bzr won't automatically get included when I do a "bzr commit".

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
John A Meinel
Solved:
Last query:
Last reply:
Revision history for this message
Best John A Meinel (jameinel) said :
#1

there is something called "filtered views" which is being worked on by Ian Clatworthy. It is a bit more of a "whitelist" in that you list things you care about, rather than a "blacklist" listing the ones you don't want "bzr commit" to touch. Though probably adding your use case wouldn't be too difficult.

That said, it is almost always better to use a template + actual form for this sort of problem. So instead of versioning "config.txt" you version "config.txt.template", and then users are expected to:
cp config.txt.template config.txt
and edit that copy.

Revision history for this message
Laszlo Pandy (laszlok) said :
#2

Thanks John A Meinel, that solved my question.

Revision history for this message
Christoph Tietz (ch-tietz) said :
#3

Within our project it is not possible to use John's proposition of using templates, because we push to a remote repo, which also serves as our host for the web application and the config files there must not be altered.

I tried to push the application with the right configs once, then remove --keep them and set these files to ignore. Unfortunately bzr pushes those changes also, therefore my files are lost in the remote repo.

Is it advisable to shelve these files, like forever?

Revision history for this message
Martin Pool (mbp) said :
#4

After you commit and push the removal, you'll need to manually restore them on the web server. Then they'll just be left alone in future.

Revision history for this message
Christoph Tietz (ch-tietz) said :
#5

Unfortunately, I do not have access to the servers. The only way to upload files is using bzr push bzr+ssh.

Revision history for this message
Jelmer Vernooij (jelmer) said :
#6

Hi Christoph,

On 05/09/11 11:20, Christoph Tietz wrote:
> Question #60156 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/60156
>
> Christoph Tietz posted a new comment:
> Within our project it is not possible to use John's proposition of using
> templates, because we push to a remote repo, which also serves as our
> host for the web application and the config files there must not be
> altered.
>
> I tried to push the application with the right configs once, then remove
> --keep them and set these files to ignore. Unfortunately bzr pushes
> those changes also, therefore my files are lost in the remote repo.
>
> Is it advisable to shelve these files, like forever?
We don't have any functionality like that at the moment, though it would
be nice to add it.

Can you perhaps run a script that updates the remote location, rather
than pushing to it directly?

Cheers,

Jelmer

Revision history for this message
Christoph Tietz (ch-tietz) said :
#7

Hey Jelmer,

thanks for letting me know.

Unfortunately, I cannot run a script to update the remote location, as the only way to access files is via bzr. We are using cloudControl, a PAAS for php, which is very nice. You can find their docs for bzr here, if it is of any interest for you:
http://cloudcontrol.com/developers/documentation/core-functions/repository/bazaar/

Cheers
Chris