tags:

views:

596

answers:

2

I have to delete a versioned file my bzr repository using bzr remove command.

bzr remove file_name

it deletes the versioned file (from the file system)

I cannot use bzr commit , (as the file has been deleted from the repository)

bzr commit

Commits all the changed file to the repository.

How do i deleted file alone, even though i have uncommited changes in my branch?

commits all the unchanged

+1  A: 

It's not clear to me what you are asking. With Bazaar version 1.6.1, I can do what you seem to want to do.

$ mkdir /tmp/wd; cd /tmp/wd
$ bzr init
$ touch foo bar
$ bzr add foo bar
added foo
added bar
$ bzr commit -m Initial
Committing to: /tmp/wd/
added foo
added bar
Committed revision 1.
$ echo 123 > bar
$ bzr rm foo 
deleted foo

Now, I've removed foo from the tree, but bar has uncommitted changes. To commit the deletion, I use:

$ bzr commit foo -m "Deleting foo"
Committing to: /tmp/wd/
deleted foo
Committed revision 2.

Revision 2 doesn't see the change to bar

$ bzr diff -r1..2
=== removed file 'foo'

but the working tree does

$ bzr diff
=== modified file 'bar'
--- bar 2009-01-20 06:06:37 +0000
+++ bar 2009-01-20 06:07:07 +0000
@@ -0,0 +1,1 @@
+123

Am I misunderstanding the questions?

Chris Conway
No, I guess this is correct. I got confused a bit :-)
Mohit Ranka
A: 

You can use bzr commit <target> to only commit certain changes in your branch. For example, if the file you removed is called testfile.php, bzr commit testfile.php will commit only the removal of that file.

This also works on directories:

bzr commit testdirectory

lzhang