test

progging - To wander about and beg; to seek food or other supplies by low arts; to seek for advantage by mean shift or tricks.
progging - Programmer slang for writing computer code.
Viser innlegg med etiketten branch. Vis alle innlegg
Viser innlegg med etiketten branch. Vis alle innlegg

onsdag 22. februar 2012

Moving a Bazaar repository

I've been using Bazaar in a centralized workflow, with a repository on a server. I wanted to move the repository to a different server that will be backed up. This was as simple as copy the complete bzr repository folder from server A to server B, and then do a bzr switch on each of the locations where I had been working on the project.

C:\Projects\ABC>bzr switch v:\bzr\ABC
Tree is up to date at revision 145.
Switched to branch: V:/bzr/ABC/


Remember to commit any changes you have first!

torsdag 11. august 2011

Bazaar: copy file from one branch to another unrelated branch


Bazaar was set up so that each program was it's own branch

\DisplayProgram
\LogProgram
\CommonSource

So moving a file (Statistics.pas) from the display program to the common source was not possible since you can't bzr move from one branch to another. So the solution was to use the export/import merge solution.

..DisplayProgram>bzr fast-export . > full-branch.fi
..DisplayProgram>bzr fast-import-filter -i Statistics.pas full-branch.fi > Statistics.fi
..DisplayProgram>mkdir ..\Temp
..DisplayProgram>bzr init ..\Temp
..DisplayProgram>bzr fast-import Statistics.fi ..\Temp
..DisplayProgram>cd ..\CommonSource
..CommonSource>bzr merge ..\Temp -r0..-1
..CommonSource>bzr commit -m "Moved file from SourceDisplay using export/import then merge"
From:
http://stackoverflow.com/questions/3547493/bzr-copy-file-from-one-branch-to-another-unrelated-branch

As a final step, after you are done moving the file, you probably want to remove the file from it's original branch.
..DisplayProgram>bzr rm Statistics.pas
..DisplayProgram>bzr commit -m "Final step of moving file to common place"

Note:
When I tried to do this a second time on another file (same directories involved), I got a problem. The old file, Statistics.pas, appeared in the temporary directory. I created a brand spanking new directory, even with a different name, but the old file seem to appear magically....
Then I read the bzr fast-import help...
Restarting an import:
 At checkpoints and on completion, the commit-id -> revision-id
 map is saved to a file called 'fastimport-id-map' in the control
 directory for the repository (e.g. .bzr/repository). If the import
 is interrupted or unexpectedly crashes, it can be started again
 and this file will be used to skip over already loaded revisions.
 As long as subsequent exports from the original source begin
 with exactly the same revisions, you can use this feature to
 maintain a mirror of a repository managed by a foreign tool.
 If and when Bazaar is used to manage the repository, this file
 can be safely deleted.
So, remove the fastimport-id-map file in the .bzr/repository directory when you are done with the import! Then you are ready to do another one :)