A branch from a sub-directory?

Alexander Belchenko bialix at ukr.net
Mon Feb 16 11:34:01 GMT 2009


Ian Clatworthy пишет:
> Gioele wrote:
>> Marius Kruger wrote:
>>>> Is there a way to create a branch from that directory without bringing in
>>>> the complete history of the previous branch but only the history of files
>>>> in that subdirectory?
> 
>> Maybe this [1] suggestion is still valid (with tailor as filter):
>>   bzr fast-export > dump.txt
>>   filter dump.txt
>>   bzr fast-import < dump.txt
>> [1] https://lists.ubuntu.com/archives/bazaar/2008q2/041664.html
> 
> That ought to work (though fast-import takes a filename or '-' to
> mean 'read from stdin').
> 
> Perhaps I should make this use case easier by adding an option to
> fast-import that takes a directory name, e.g. something like:
> 
>   bzr fast-export > dump.txt
>   bzr init-repo ~/new-proj
>   cd ~/new-proj
>   bzr fast-import --only mydir dump.txt
>   cd -
>   bzr rm mydir
>   bzr commit -m "removed mydir as now a separate project"
> 
> If the idea is useful, I'd like some feedback on the best option
> name. Would it be better to only support one dir, or make --only
> be a list option, or make --only take a file containing the paths
> of interest? (My leaning is towards a list option and items can
> be plain files or symlinks as well, not just dirs.)
> 
> What do you think?

Will be nice to have this at minimum for some directory, at maximum
for one or several files from some list (providing list in a file --
it's fine).

I need this very often, especially for my scmproj plugin now.




More information about the bazaar mailing list