How to revert a branch? / Branch nicks?

Marcelo Alves marcelo.alves at me.com
Tue Sep 15 04:26:14 BST 2009


Hi,

   (ok, I think I should write two e-mails instead of just once with  
two questions, but they're closely related, trust me)

I'm writing some docs to my developers about bzr and the features  
provided, but I cannot answer two questions :

   1. How to unmerge / revert a branch? and
   2. Why the -r parameter (help revisionspec) does not accept branch  
nicks, but it accepts branch paths?

Explaining my case in detail :
   We're using the "Sorted by status" layout[1], and bzr log --forward  
--n0 on main/ gave me something like :

------------------------------------------------------------
revno: 1

[...snip...]

------------------------------------------------------------
revno: 658
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
------------------------------------------------------------
revno: 659
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
------------------------------------------------------------
revno: 660 [merge]
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
     ------------------------------------------------------------
     revno: 644.1.8
     committer: Developer Three<developer.three at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.9 [merge]
     committer: Developer Three<developer.three at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.10
     committer: Developer Three<developer.three at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.11
     committer: Developer Three<developer.three at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.12 [merge]
     committer: Developer Three<developer.three at i-like-spam.cc>
     branch nick: main-tree
         ------------------------------------------------------------
         revno: 644.2.1
         committer: Developer Two<developer.two at main-tree.com>
         branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.13
     committer: Developer Two<developer.two at main-tree.com>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 644.1.14
     committer: Developer Two<developer.two at main-tree.com>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 656.1.1 [merge]
     committer: Developer One<developer.one at i-like-spam.cc>
     branch nick: the-forgotten-patch
------------------------------------------------------------
revno: 661
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
------------------------------------------------------------
revno: 662
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
------------------------------------------------------------
revno: 663 [merge]
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: new-feature
     ------------------------------------------------------------
     revno: 654.1.1
     committer: Developer One<developer.one at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 654.1.2 [merge]
     committer: Developer One<developer.one at i-like-spam.cc>
     branch nick: main-tree
     ------------------------------------------------------------
     revno: 654.1.3
     committer: Developer One<developer.one at i-like-spam.cc>
     branch nick: emergency-fix
------------------------------------------------------------
revno: 664
committer: Developer One<developer.one at i-like-spam.cc>
branch nick: main-tree

[...snip...]

Before you scream "You liar, this ain't the 'Sorted by Status'  
layout!", let me explain: we started the sorted by status layout  
today, and this is part of the documentation.

Now, suppose I'd like to remove the "new-feature" branch nick. What  
I've tried so far, without luck :

   'bzr revert branch:../new-feature' : it does not work as expected,  
reverts just the last revision (663);
   'bzr revert ancestor:../new-feature' : same as above;
   'bzr revert -1000:../new-feature' : reverts to rev 1;
   'bzr revert 1:../new-feature' : reverts to rev 1 (hmm, am I a dumb  
user or it is a documentation error?);

Of course, I can revert manually all revisions with the "new-feature"  
branch nick, but why we cannot use something like 'bzr revert  
branch:../new-feature' ? or better yet, why not 'bzr revert branch- 
nick:new-feature'? What happens if I delete the branch and want to  
delete it (like, a license violation, eek)? Should I start hacking  
bzr? Should I fix the bzr documentation? Should I cry? :D

Thanks for explanations or links pointing to answers.

[1]: http://doc.bazaar-vcs.org/bzr.dev/en/user-guide/index.html#sorted-by-status-dev-merged-experimental



More information about the bazaar mailing list