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 +4 -4
- data/lib/takeltau/default.yml +0 -1
- data/lib/takeltau/git/lib.rb +24 -27
- data/lib/takeltau/hg/pull.rb +7 -24
- data/lib/takeltau/hg/push.rb +7 -17
- data/lib/takeltau/version +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 293a71b537a49394f198b0a1479285f57e43d899ccaffdcf64f18e91a95a4445
|
4
|
+
data.tar.gz: 00e04f3a868ac61e81660b4e37e74a83d055c72d591ca53be88e04c48b32e488
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f259593b1df8171bcd2400ba152a55c430b3c535e8c8f5abe6cbc3e66c4484947e32472d0ff612e848f0429ee96424306329f0a7abc063f116c9610396fb628
|
7
|
+
data.tar.gz: b71b36fcba29683483fa39e35e46293dac09c61c6b1603977605ab0eacf16eefe12867058160544ac21774b05a0f34b95c24baf7b915c18530a60cebb3fe3dcc
|
data/lib/takeltau/default.yml
CHANGED
@@ -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}'
|
data/lib/takeltau/git/lib.rb
CHANGED
@@ -2,23 +2,29 @@
|
|
2
2
|
|
3
3
|
# tau git lib
|
4
4
|
module GitLib
|
5
|
-
#
|
6
|
-
|
7
|
-
|
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
|
-
|
10
|
-
end
|
10
|
+
return false unless configured? %w[project_root_dir]
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
unless git_check_hg
|
13
|
+
log.error 'Not on git hg branch'
|
14
|
+
return false
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
unless git_check_clean
|
18
|
+
log.error 'No clean git workspace'
|
19
|
+
return false
|
20
|
+
end
|
19
21
|
|
20
|
-
|
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
|
-
|
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
|
data/lib/takeltau/hg/pull.rb
CHANGED
@@ -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
|
9
|
+
return false unless git_lib_prepare_git_workspace
|
12
10
|
|
13
|
-
unless
|
14
|
-
log.error '
|
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
|
-
|
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
|
-
|
28
|
+
stdout, _, exitstatus = run_and_capture cmd_hg_pull_repos
|
29
|
+
log.info stdout
|
30
|
+
exitstatus.zero?
|
48
31
|
end
|
49
32
|
end
|
data/lib/takeltau/hg/push.rb
CHANGED
@@ -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
|
9
|
+
return false unless git_lib_prepare_git_workspace
|
11
10
|
|
12
|
-
unless
|
13
|
-
log.error '
|
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
|
-
|
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
|
-
|
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.
|
1
|
+
0.37.1
|