<commit_before>#!/bin/bash

if [[ $OPENERP_REPO_BASE == "" ]]; then
    OPENERP_REPO_BASE=~/Development/openerp
fi

OPENERP_REPO_BASE=$(readlink -m $OPENERP_REPO_BASE)

function branch_project {
    # $1: Project name
    # $2,3,4,...: Original branches
    echo ""
    echo ""
    echo "Project: $1"
    echo "--------------------------------------------------------------"
    echo ""
    
    REPO_DIR=$OPENERP_REPO_BASE/$1
    
    echo "Create repository $REPO_DIR"
    if [ -d $REPO_DIR ]; then
        echo "repository already exists, delete before running the script to recreate"
        echo "$REPO_DIR"
    else
        echo "bzr init-repo --no-tree $REPO_DIR"
        bzr init-repo --no-tree $REPO_DIR
    fi
    echo ""
    
    echo "Subdirectories creation"
    if [ -d $REPO_DIR/main ]; then
        echo "main already exists, delete before running the script to recreate"
        echo "$REPO_DIR/main"
    else
        echo "mkdir $REPO_DIR/main"
        mkdir $REPO_DIR/main
    fi
    if [ -d $REPO_DIR/features ]; then
        echo "features already exists, delete before running the script to recreate"
        echo "$REPO_DIR/features"
    else
        echo "mkdir $REPO_DIR/features"
        mkdir $REPO_DIR/features
    fi
    echo ""
    
    echo "Main branches creation"
    echo ""
    args=("$@")
    start=1
    let "stop=$#-1"
    for i in `seq $start $stop`; do
        branch=${args[$i]}
        LP_OERP="lp:$1/$branch"
        LP_CCORP="lp:~clearcorp/$1/${branch}-ccorp"
        echo "Branch creation: $1/$branch"
        
        echo "Branch $LP_OERP"
        echo "bzr branch $LP_OERP $REPO_DIR/main/$branch"
        bzr branch $LP_OERP $REPO_DIR/main/$branch
        echo "Branch $LP_CCORP"
        echo "bzr branch $LP_CCORP $REPO_DIR/main/${branch}-ccorp"
        bzr branch $LP_CCORP $REPO_DIR/main/${branch}-ccorp
<commit_msg>[IMP] openerp-repository-make.sh check for existance<commit_after>#!/bin/bash

if [[ $OPENERP_REPO_BASE == "" ]]; then
    OPENERP_REPO_BASE=~/Development/openerp
fi

OPENERP_REPO_BASE=$(readlink -m $OPENERP_REPO_BASE)

function branch_project {
    # $1: Project name
    # $2,3,4,...: Original branches
    echo ""
    echo ""
    echo "Project: $1"
    echo "--------------------------------------------------------------"
    echo ""
    
    REPO_DIR=$OPENERP_REPO_BASE/$1
    
    echo "Create repository $REPO_DIR"
    if [ -d $REPO_DIR ]; then
        echo "repository already exists, delete before running the script to recreate"
        echo "$REPO_DIR"
    else
        echo "bzr init-repo --no-tree $REPO_DIR"
        bzr init-repo --no-tree $REPO_DIR
    fi
    echo ""
    
    echo "Subdirectories creation"
    if [ -d $REPO_DIR/main ]; then
        echo "main already exists, delete before running the script to recreate"
        echo "$REPO_DIR/main"
    else
        echo "mkdir $REPO_DIR/main"
        mkdir $REPO_DIR/main
    fi
    if [ -d $REPO_DIR/features ]; then
        echo "features already exists, delete before running the script to recreate"
        echo "$REPO_DIR/features"
    else
        echo "mkdir $REPO_DIR/features"
        mkdir $REPO_DIR/features
    fi
    echo ""
    
    echo "Main branches creation"
    echo ""
    args=("$@")
    start=1
    let "stop=$#-1"
    for i in `seq $start $stop`; do
        branch=${args[$i]}
        LP_OERP="lp:$1/$branch"
        LP_CCORP="lp:~clearcorp/$1/${branch}-ccorp"
        echo "Branch creation: $1/$branch"
        
        echo "Branch $LP_OERP"
        if [ -d $REPO_DIR/main/$branch/.bzr ]; then
            echo "$REPO_DIR/main/$branch already exists, delete before running the script to recreate"
        else
            echo "bzr branch $LP_OERP $REPO_DIR/main/$branch"
            bzr branch $LP_OERP $REPO_DIR/main/$branch
        fi
        
        echo "Branch $LP_CCORP"
        if [ -d $REPO_DIR/main/${branch}-ccorp/.bzr ]; then
            echo "$REPO_DIR/main/${branch}-ccorp already exists, delete before running the script to recreate"
        else
            echo "bzr branch $LP_CCORP $REPO_DIR/main/${branch}-ccorp"
            bzr branch $LP_CCORP $REPO_DIR/main/${branch}-ccorp
        fi

{'fraction_non_alphanumeric': 0.14453499520613614, 'fraction_numerical': 0.0052732502396931925, 'mean_word_length': 2.057142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6339981', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1389, 'n_words': 352}