Delete the parent branch in the bazaar

Given the following scenario:

$ bzr init-repo foo
$ bzr init foo/bar
$ cd foo/bar
$ echo 'some text' > a_file
$ bzr add a_file 
$ bzr commit -m 'a commit message' 
$ cd ..
$ bzr branch bar trunk
$ bzr rmbranch bar
bzr: ERROR: Branch is active. Use --force to remove it.

Is it bzr rmbranch --forcesafe to do in this situation ? Isn't there a more elegant solution?

After execution bzr rmbranch --force, bzr infoit still shows ../foo/baras the parent branch trunk, how can I change this?

+3
source share
2 answers

bzr rmbranchjust removes the branch at that location. This is very convenient if you need to delete a branch on the server.

On your local drive, just use the command rmor del(depending on your OS / shell) if you want to remove the branch and tree.

. rmbranch , , . ( ). rm.

.bzr/branch/branch.conf. . .

+4

(, , "" bzr.)

bzr: bzr init-repo, bzr init, bzr branch, bzr info, bzr add, bzr commit, bzr remove-tree, bzr remove-branch.

/tmp, .

$ cd /tmp/
$ bzr init-repo test-shared-repo
$ bzr info test-shared-repo/

:

Shared repository with trees (format: 2a)
Location:
  shared repository: test-shared-repo

:

$ bzr init test-shared-repo/first

: , "" , ( ):

Using shared repository: /tmp/test-shared-repo/

:

$ cd test-shared-repo
$ bzr info 

, , , :

Shared repository with trees (format: 2a)
Location:
  shared repository: .

"" , :

$ bzr info first/

, , "" , , .:

Repository tree (format: 2a)
Location:
  shared repository: .
  repository branch: first

, "" "" , :

$ cd first/
$ echo "some text" > a_file.txt
$ bzr add a_file.txt
$ bzr commit -m 'a commit message' 
$ cd ..

"first" "second":

$ bzr branch first second

, , "" "" :

Repository tree (format: 2a)
Location:
  shared repository: .
  repository branch: second

Related branches:
  parent branch: first

bzr info first, , "" . , - :

$ ls second
a_file.txt

, "" "", .. , "bzr remove-branch" :

$ bzr remove-branch first
bzr: ERROR: Branch is active. Use --force to remove it.
$ bzr remove-branch second
bzr: ERROR: Branch is active. Use --force to remove it.

- bzr remove-tree, , , . ( , ), !

$ bzr remove-tree second
$ ls -a second
.  ..  .bzr

"". - "" :

$ bzr info second
Repository branch (format: 2a)
Location:
  shared repository: .
  repository branch: second

Related branches:
  parent branch: first

, bzr remove-branch "second":

$ bzr remove-branch second
$ bzr info second
Empty control directory (format: 2a or pack-0.92)
Location:
  control directory: second

, "" , (rm/del) "" .

(, , , .)

0

All Articles