Module: GitLib

Included in:
Takeltau::Hg
Defined in:
lib/takeltau/git/lib.rb

Overview

tau git lib

Instance Method Summary collapse

Instance Method Details

#git_lib_prepare_git_workspaceObject

Prepare git workspace.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/takeltau/git/lib.rb', line 6

def git_lib_prepare_git_workspace
  log.debug 'Prepare git workspace'

  return false unless configured? %w[project_root_dir]

  unless git_check_hg
    log.error 'Not on git hg branch'
    return false
  end

  unless git_check_clean
    log.error 'No clean git workspace'
    return false
  end

  return true if _git_lib_git_pull_origin_hg

  log.error 'Unable to pull git workspace'
  false
end

#git_lib_push_hg_dirsObject

Push git workspace.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/takeltau/git/lib.rb', line 28

def git_lib_push_hg_dirs
  log.info 'Pushing git workspace'

  message = 'Update .hg mercurial directories'

  return false unless _git_lib_git_add_hg_dirs

  # Do not fail or a clean workspace triggers a return
  _git_lib_git_commit message

  return true if _git_lib_git_push_origin_hg

  log.debug 'Unable to git push .hg mercurial directories'
  false
end