def initialize(path=nil)
GitMaintain::checkDirectConstructor(self.class)
@path = path
@branch_list=nil
@stable_branches=nil
@suffix_list=nil
if path == nil
@path = Dir.pwd()
end
@valid_repo = runGit("config maintain.valid-repo 2> /dev/null").chomp()
@valid_repo = @@VALID_REPO if @valid_repo == ""
@stable_repo = runGit("config maintain.stable-repo 2>/dev/null").chomp()
@stable_repo = @@STABLE_REPO if @stable_repo == ""
@remote_valid=runGit("remote -v | egrep '^#{@valid_repo}' | grep fetch |
awk '{ print $2}' | sed -e 's/.*://' -e 's/\\.git//'")
@remote_stable=runGit("remote -v | egrep '^#{@stable_repo}' | grep fetch |
awk '{ print $2}' | sed -e 's/.*://' -e 's/\\.git//'")
@branch_format_raw = runGit("config maintain.branch-format 2> /dev/null").chomp()
@branch_format = Regexp.new(/#{@branch_format_raw}/)
@stable_branch_format = runGit("config maintain.stable-branch-format 2> /dev/null").chomp()
@stable_base_format = runGit("config maintain.stable-base-format 2> /dev/null").chomp()
@stable_base_patterns=
runGit("config --get-regexp stable-base | egrep '^stable-base\.' | "+
"sed -e 's/stable-base\.//' -e 's/---/\\//g'").split("\n").inject({}){ |m, x|
y=x.split(" ");
m[y[0]] = y[1]
m
}
end