How to export Bazaar history to a subfolder

I am coding a framework with a project that uses this structure. The project is a Bazaar repository, and the structure in a subfolder below the project.

I want to provide the platform with my own Bazaar bazaar. How to do it?

+4
source share
6 answers

You use the split command:

bzr split sub_folder 

This creates an independent tree in a subfolder that you can now export and work separately.

+6
source

Use the fast-import plugin ( http://bazaar-vcs.org/BzrFastImport ):

1) Export the whole story to the stream:

 bzr fast-export BRANCH > full-history.fi 

2) Filter the history to create a new stream:

 bzr fast-import-filter -i subfolder full-history.fi > subfolder.fi 

3) Create a new branch with only a subfolder:

 bzr init-repo . bzr fast-import subfolder.fi 
+6
source

As far as I know, there is no way to do this easily with the bazaar. One of the possibilities is to take the original project, branch it, and then delete everything that is not connected with the framework. Then you can move the files in subdir to the main directory. This is pretty hard work, but you can keep the story.

you will get something like:

 branch project: .. other files.. framework/a.file framework/b.file framework/c.file branch framework: a.file b.file c.file 
0
source

As far as I know, "nested" branches are not yet supported by Bazaar. Git supports "submodules" that behave similarly to external Subversion.

0
source

I tried to do this using bzr split, however this does not work as I expect.

  • The resulting branch still contains a history of all files from all source directories, and a full check retrieves all files. It seems that the only thing split does is convert the repository to a rich root repository, so this particular tree can only be from a subdirectory alone, but the repository still contains all the other directories, and other checks can still extract the whole tree.

I used the method in jamuraa's answer above, and it was much better for me, since I did not have to interfere with the conversion to a new type of repository. It also meant that a full check / fork from this repository only recreated the files I wanted.

However, it was still a drawback that the vault kept a history of all these โ€œdeletedโ€ files, which meant that it needed more space than necessary (and could be a privacy issue if you don't want people to be able to see old versions of these "other" directories).

Thus, there are more tips for shredding the Bazar branch down to one of its subdirectories, while the final deletion of the history of everything else would be appreciated.

0
source

Do

 bzr init . bzr add . bzr commit 

in the framework directory.

Then you can branch and merge only with this directory.

The bazaar above will ignore this directory until you make a connection.

The bazaar understands when you do things like

 bzr branch . mycopy bzr branch . myothercopy 

Current .bzr directories will not track changes to these subdirectories.

This saves you from trying to find a place to post the branch.

0
source

Source: https://habr.com/ru/post/1276716/


All Articles