Question about features

Joke de Buhr at
Mon Nov 2 22:40:36 GMT 2009

On Monday 02 November 2009 22:14:38 Daniel Carrera wrote:
> Hello,
> I have been using Darcs for a while. There are two features in Darcs
> that I use a lot and I'd like to know if Bazaar has something similar:
> 1) When I run "darcs record" (same as "bzr commit") I can see the
> individual changes in each file and I get to pick which changes I want
> to record. If I change two lines in a file, I can record one change
> and not the other.
> 2) I can unrecord changes (similar to "bzr uncommit"), but I can go
> back in history and basically cherry pick which changes I want to
> uncommit. For example:
> -> Commit Feature A
> -> Commit Feature B
> Ooops, I made a mistake in A.
> -> Uncommit Feature A
> Fix feature A.
> -> Commit Feature A.
> Can Bazaar do these things?
> I use these features all the time in my regular, day to day workflow.
> I am a web developer. Whenever I make a change, I push it to a server
> where I test my work. That means that I have a lot of commits that are
> just "test". When I finish a feature I un-record/un-commit all my
> changes and then make a single nice patch with the entire feature.
> Some times I'll be working on "Feature A" and the boss asks me to fix
> a bug in Feature B. So I fix Feature B, then I go back to Feature A.
> When I finish Feature A I unrecord all the little changes that led to
> Feature A and I re-record them as a single "Feature A" patch.
> Can Bazaar adapt to my workflow?
> Thanks,
> Daniel.


1) Recording (Commiting) individual line changes within one file isn't 
possible out of the box. But it's possible to commit only a selection of 
changed files:
  bzr commit FileA FileB pathX/FileC pathY/FileC

If you want to commit individual patch hunks (linechanges) you can try the 
interactive plugin:
It enables interactive commits by selecting individual patch hunks during 
  bzr commit -i

2) Cherry picking isn't possible with uncommit. everything is reverted up 
to the revision specified with "bzr uncommit -r RevID".

As an alternative it's possible to use cherry picking with merge.
You can use a command like this:

  bzr log --line
    4: Feature D
    3: Feature C
    2: Feature B
    1: Feature A

  bzr merge -r 3::2
  bzr commit -m "Modified Feature C"

Reverts only changes introduced within Feature C. NOT the changes make 
during Feature B. Later on just do a normal commit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : 

More information about the bazaar mailing list