Vincent Broman | 3 Oct 00:02
Favicon

how do I commit somewhere other than onto a tip?

I think I need the capability to commit versions that are not
successors of a tip revision, e.g. I want to commit a new version
which should be placed in between two successive versions already committed,
or else to place it ahead of all the other versions, as a new version 1.
It might even be a new branch off some parent version in the past.

Why? I have inherited a piece of software to maintain for which I
have found many tens of copies of the source in various stages of development,
stored in separate directory trees on various machines or backups.
From file modtimes and from looking at diffs, I have an
approximate idea of the order they should appear in history.
I would like to get everything into a version control system, to document it,
but I cannot just start with the earliest and try to retrace everything
from the big bang to the present in order.

As I go through I may change my mind as to the dependencies/order.
I may find an additional version on a dusty backup after I have started. 
I may only have time to process the last 10-15 versions right now, 
then add in the other older versions as I have time to analyze them later.

My basic problem is recording history retrospectively, instead of
as it happens.  Is this possible in Bazaar?
I do not like the idea of writing code to do surgery on archives
in ways they were not designed to allow, but concatenating dump files
is something subversion sort-of allows.

Vincent Broman
SpaWar Systems Center - Pacific

(Continue reading)

John Arbash Meinel | 3 Oct 00:13
Favicon

Re: how do I commit somewhere other than onto a tip?


Vincent Broman wrote:
> I think I need the capability to commit versions that are not
> successors of a tip revision, e.g. I want to commit a new version
> which should be placed in between two successive versions already committed,
> or else to place it ahead of all the other versions, as a new version 1.
> It might even be a new branch off some parent version in the past.

You may want to look at the "bzr-rebase" plugin. Which effectively has
you do:

bzr branch current -r LAST new
cd new
bzr commit -m "This is the real LAST+1"
bzr replay -r LAST+1 ../current
cd ..
rm -rf current; mv new current

Basically, you create a new branch, from what you consider the correct
base. Then you commit the new version, and replay the old revisions.
This will generate a new set of revisions, but they should match the others.

This may not work exactly as you want, as I think replay (and rebase in
general) try to apply them as *patches* when really you want them
applied as snapshots.

There are other ways that you could script something like this, though I
wouldn't guarantee how fast it would be.

It seems like an interesting problem, though.
(Continue reading)

Vincent Ladeuil | 3 Oct 08:44
Favicon

Re: how do I commit somewhere other than onto a tip?

>>>>> "Vincent" == Vincent Broman <broman <at> spawar.navy.mil> writes:

Hi Vincent,

    Vincent> I think I need the capability to commit versions
    Vincent> that are not successors of a tip revision, 

Basically you can't.

    Vincent> e.g. I want to commit a new version which should be
    Vincent> placed in between two successive versions already
    Vincent> committed, or else to place it ahead of all the
    Vincent> other versions, as a new version 1.  It might even
    Vincent> be a new branch off some parent version in the past.

Then create a new branch starting at the tip you're interested
in, commit there, and... either merge into your work-in-progress
trunk or merge in this new branch and makes it your new
work-in-progress trunk.

    Vincent> Why? I have inherited a piece of software to
    Vincent> maintain for which I have found many tens of copies
    Vincent> of the source in various stages of development,
    Vincent> stored in separate directory trees on various
    Vincent> machines or backups.

Been there, done that, you're in for quite a journey, good luck,
it's a tough job, but the reward is high.

    Vincent> From file modtimes and from looking at diffs, I have
(Continue reading)

Vincent Broman | 4 Oct 01:26
Favicon

Re: how do I commit somewhere other than onto a tip?

On Thursday, 02 October 2008, Vincent Ladeuil wrote:
>     Vincent> e.g. I want to commit a new version which should be
>     Vincent> placed in between two successive versions already
>     Vincent> committed, or else to place it ahead of all the
>     Vincent> other versions, as a new version 1.  It might even
>     Vincent> be a new branch off some parent version in the past.
> 
> Then create a new branch starting at the tip you're interested
> in, commit there, and... either merge into your work-in-progress
> trunk or merge in this new branch and makes it your new
> work-in-progress trunk.

Meinel suggested something similar, but here is the problem:
Say I have versions A,B,C

A -> B -> C

Now I commit AA which is supposed to be a successor of A and predecessor of B.

A      -> B -> C
 -> AA

There is a diff from A to B and a diff from A to AA, but
nowhere is there a diff from AA to B.
If I do a merge, the result will not be equal to B or C.
If I rewind to

A -> AA

and then replay here the diff of A to B, I don't end up with B.
(Continue reading)

Favicon

Re: how do I commit somewhere other than onto a tip?

Vincent Broman writes:

 > Meinel suggested something similar, but here is the problem:
 > Say I have versions A,B,C
 > 
 > A -> B -> C
 > 
 > Now I commit AA which is supposed to be a successor of A and predecessor of B.
 > 
 > A      -> B -> C
 >  -> AA
 > 

Do it in git, which is designed for precisely this kind of surgery on
commit DAGs.  Then use tailor or similar to transform the git repo to
a bzr repo, and go forth and sin no more after that.

Lukáš Lalinský | 4 Oct 08:56

Re: how do I commit somewhere other than onto a tip?

On Sat, Oct 4, 2008 at 1:26 AM, Vincent Broman <broman <at> spawar.navy.mil> wrote:
> Meinel suggested something similar, but here is the problem:
> Say I have versions A,B,C
>
> A -> B -> C
>
> Now I commit AA which is supposed to be a successor of A and predecessor of B.
>
> A      -> B -> C
>  -> AA
>
> There is a diff from A to B and a diff from A to AA, but
> nowhere is there a diff from AA to B.
> If I do a merge, the result will not be equal to B or C.
> If I rewind to
>
> A -> AA
>
> and then replay here the diff of A to B, I don't end up with B.
> If I just commit a copy of B after AA, then I get
>
> A -> AA -> B
>
> which is right, except this B is not the ancestor of C.
> I think this leads to redoing all the commits that I had following B, by hand.

/tmp$ bzr init branch1
Standalone tree (format: pack-0.92)
Location:
  branch root: branch1
(Continue reading)


Gmane