takeltau 0.36.5 → 0.37.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f0384f3e2dd7b515d5943dfc67d59f75c429d56c8fa6473cf2c6fe564181cbf
4
- data.tar.gz: bd538e579d0f138e832e09d3a5656e345a7d43db364bbbf31bcea6526250f6d4
3
+ metadata.gz: 293a71b537a49394f198b0a1479285f57e43d899ccaffdcf64f18e91a95a4445
4
+ data.tar.gz: 00e04f3a868ac61e81660b4e37e74a83d055c72d591ca53be88e04c48b32e488
5
5
  SHA512:
6
- metadata.gz: 36da5dad2130782a8c53bcbdc165b077e85a8d6f7457aff1f64e36f4efcea523a34a010dd63ea44918517e30dfde63f3ea249cc71d8b3e8d9cb39a7f47644112
7
- data.tar.gz: ce7d8a4eccd384f9239037e43e77d419d10cfe1d56d4234eabcf59014c7b4426578cf91a6a43bba9f623ec93b8d7e2d03f94f19b980d3a7131deab91afe66be3
6
+ metadata.gz: 4f259593b1df8171bcd2400ba152a55c430b3c535e8c8f5abe6cbc3e66c4484947e32472d0ff612e848f0429ee96424306329f0a7abc063f116c9610396fb628
7
+ data.tar.gz: b71b36fcba29683483fa39e35e46293dac09c61c6b1603977605ab0eacf16eefe12867058160544ac21774b05a0f34b95c24baf7b915c18530a60cebb3fe3dcc
@@ -23,7 +23,6 @@ cmd_git_check_clean_git_status: 'git status --porcelain'
23
23
  cmd_git_check_hg_get_git_branch: 'git symbolic-ref HEAD'
24
24
  cmd_git_check_workspace_git_repo: 'git -C %{dir} rev-parse'
25
25
  cmd_git_check_workspace_pwd: 'pwd'
26
- cmd_git_lib_git_add_all: 'git add --all'
27
26
  cmd_git_lib_git_add_hg_dirs: 'git add \*/.hg/\*'
28
27
  cmd_git_lib_git_commit: 'git commit --message="%{message}"'
29
28
  cmd_git_lib_git_pull_origin: 'git pull origin %{main}'
@@ -2,23 +2,29 @@
2
2
 
3
3
  # tau git lib
4
4
  module GitLib
5
- # Pull git workspace.
6
- def git_lib_pull_workspace
7
- log.info 'Pulling git workspace'
5
+ # Prepare git workspace.
6
+ # rubocop:disable Metrics/MethodLength
7
+ def git_lib_prepare_git_workspace
8
+ log.debug 'Prepare git workspace'
8
9
 
9
- _git_lib_git_pull_origin_hg
10
- end
10
+ return false unless configured? %w[project_root_dir]
11
11
 
12
- # Push git workspace.
13
- def git_lib_push_workspace(message)
14
- log.info 'Pushing git workspace'
12
+ unless git_check_hg
13
+ log.error 'Not on git hg branch'
14
+ return false
15
+ end
15
16
 
16
- return false unless _git_lib_git_add_all
17
- return false unless _git_lib_git_commit message
18
- return false unless _git_lib_git_pull_origin_hg
17
+ unless git_check_clean
18
+ log.error 'No clean git workspace'
19
+ return false
20
+ end
19
21
 
20
- _git_lib_git_push_origin_hg
22
+ return true if _git_lib_git_pull_origin_hg
23
+
24
+ log.error 'Unable to pull git workspace'
25
+ false
21
26
  end
27
+ # rubocop:enable Metrics/MethodLength
22
28
 
23
29
  # Push git workspace.
24
30
  def git_lib_push_hg_dirs
@@ -29,30 +35,21 @@ module GitLib
29
35
  return false unless _git_lib_git_add_hg_dirs
30
36
  return false unless _git_lib_git_commit message
31
37
 
32
- _git_lib_git_push_origin_hg
33
- end
34
-
35
- private
36
-
37
- # git add all.
38
- def _git_lib_git_add_all
39
- log.debug 'Adding all files to git'
40
-
41
- cmd_git_add_all = config.active['cmd_git_lib_git_add_all']
38
+ return true if _git_lib_git_push_origin_hg
42
39
 
43
- return true if try cmd_git_add_all
44
-
45
- log.error 'Unable to add all files to git'
40
+ log.error 'Unable to git push .hg mercurial directories'
46
41
  false
47
42
  end
48
43
 
44
+ private
45
+
49
46
  # git add hg dirs.
50
47
  def _git_lib_git_add_hg_dirs
51
48
  log.debug 'Adding all .hg mercurial dirs to git'
52
49
 
53
50
  cmd_git_add_hg_dirs = config.active['cmd_git_lib_git_add_hg_dirs']
54
51
 
55
- return true if try cmd_git_add_hg_dirs
52
+ return true if (try cmd_git_add_hg_dirs).exitstatus.zero?
56
53
 
57
54
  log.error 'Unable to add all .hg mercurial dirs to git'
58
55
  false
@@ -67,7 +64,7 @@ module GitLib
67
64
  message: message
68
65
  )
69
66
 
70
- return true if try cmd_git_commit
67
+ return true if (try cmd_git_commit).exitstatus.zero?
71
68
 
72
69
  log.error 'Unable to commit to git'
73
70
  false
@@ -3,37 +3,18 @@
3
3
  # tau hg pull
4
4
  module HgPull
5
5
  # Backend method for hg pull.
6
- # rubocop:disable Metrics/AbcSize
7
- # rubocop:disable Metrics/MethodLength
8
6
  def hg_pull
9
7
  log.debug 'Pull hg repos'
10
8
 
11
- return false unless configured? %w[project_root_dir]
9
+ return false unless git_lib_prepare_git_workspace
12
10
 
13
- unless git_check_hg
14
- log.error 'Not on git hg branch'
11
+ unless _hg_pull_hg_pull_repos
12
+ log.error 'Unable to tau hg pull'
15
13
  return false
16
14
  end
17
15
 
18
- unless git_check_clean
19
- log.error 'No clean git workspace'
20
- return false
21
- end
22
-
23
- unless git_lib_pull_workspace
24
- log.error 'Unable to pull git workspace'
25
- return false
26
- end
27
-
28
- log.info _hg_pull_hg_pull_repos
29
-
30
- return true if git_lib_push_hg_dirs
31
-
32
- log.error 'Unable to push .hg mercurial directories'
33
- false
16
+ git_lib_push_hg_dirs
34
17
  end
35
- # rubocop:enable Metrics/MethodLength
36
- # rubocop:enable Metrics/AbcSize
37
18
 
38
19
  private
39
20
 
@@ -44,6 +25,8 @@ module HgPull
44
25
  root: config.active['project_root_dir']
45
26
  )
46
27
 
47
- run cmd_hg_pull_repos
28
+ stdout, _, exitstatus = run_and_capture cmd_hg_pull_repos
29
+ log.info stdout
30
+ exitstatus.zero?
48
31
  end
49
32
  end
@@ -3,30 +3,18 @@
3
3
  # tau hg push
4
4
  module HgPush
5
5
  # Backend method for hg push.
6
- # rubocop:disable Metrics/MethodLength
7
6
  def hg_push
8
7
  log.debug 'Push hg repos'
9
8
 
10
- return false unless configured? %w[project_root_dir]
9
+ return false unless git_lib_prepare_git_workspace
11
10
 
12
- unless git_check_hg
13
- log.error 'Not on git hg branch'
11
+ unless _hg_push_hg_push_repos
12
+ log.error 'Unable to tau hg push'
14
13
  return false
15
14
  end
16
15
 
17
- unless git_check_clean
18
- log.error 'No clean git workspace'
19
- return false
20
- end
21
-
22
- log.info _hg_push_hg_push_repos
23
-
24
- return true if git_lib_push_workspace 'tau hg push'
25
-
26
- log.error 'Unable to push git workspace'
27
- false
16
+ git_lib_push_hg_dirs
28
17
  end
29
- # rubocop:enable Metrics/MethodLength
30
18
 
31
19
  private
32
20
 
@@ -37,6 +25,8 @@ module HgPush
37
25
  root: config.active['project_root_dir']
38
26
  )
39
27
 
40
- run cmd_hg_push_repos
28
+ stdout, _, exitstatus = run_and_capture cmd_hg_push_repos
29
+ log.info stdout
30
+ exitstatus.zero?
41
31
  end
42
32
  end
data/lib/takeltau/version CHANGED
@@ -1 +1 @@
1
- 0.36.5
1
+ 0.37.1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takeltau
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.36.5
4
+ version: 0.37.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takelwerk