Skip to content
Snippets Groups Projects
bookmark_subprojects_all 610 B
Newer Older
#!/bin/zsh

# TODO if a project was added at a later version it is bookmarked anyway (which is incorrect)
# TODO to fix that, the .hgconf need to be parsed instead of parsing directories directly

project=$(echo ${PWD##*/} | sed "s/_openerp/ /g")
previous_hash=$(hg identify -i)
for version in $(hg log -T "{if(tags, '{tags}\n')}");
do
	hg -q update $version
	hg -q ensureconf
	tag=${project}$(hg id -t| sed "s/TAG_//g")
	echo $tag
	for dir in */;
	do
	    pushd $dir
	    if [[ -d .hg ]];
	    then
	        hg bookmark -i "$tag";
	    fi
	    popd
	done
done
# back to previous hash
hg -q up $previous_hash