takeltau 0.34.15 → 0.35.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/takeltau/completion/cli.rb +1 -1
- data/lib/takeltau/default.yml +10 -35
- data/lib/takeltau/docker/check/cli.rb +1 -1
- data/lib/takeltau/docker/check/daemon.rb +1 -1
- data/lib/takeltau/docker/cli.rb +1 -1
- data/lib/takeltau/docker/container/check/cli.rb +1 -1
- data/lib/takeltau/docker/container/check/existing.rb +1 -1
- data/lib/takeltau/docker/container/check/network.rb +1 -1
- data/lib/takeltau/docker/container/check/orphaned.rb +1 -1
- data/lib/takeltau/docker/container/clean.rb +1 -1
- data/lib/takeltau/docker/container/cli.rb +1 -1
- data/lib/takeltau/docker/container/command.rb +1 -1
- data/lib/takeltau/docker/container/daemon.rb +1 -1
- data/lib/takeltau/docker/container/lib.rb +1 -1
- data/lib/takeltau/docker/container/login.rb +1 -1
- data/lib/takeltau/docker/container/prune.rb +1 -1
- data/lib/takeltau/docker/image/cli.rb +1 -1
- data/lib/takeltau/docker/image/tag/check.rb +1 -1
- data/lib/takeltau/docker/image/tag/cli.rb +1 -1
- data/lib/takeltau/docker/image/tag/latest.rb +1 -1
- data/lib/takeltau/docker/image/tag/list.rb +1 -1
- data/lib/takeltau/docker/image/update.rb +1 -1
- data/lib/takeltau/git/check/clean.rb +1 -1
- data/lib/takeltau/git/check/cli.rb +14 -14
- data/lib/takeltau/git/check/hg.rb +26 -0
- data/lib/takeltau/git/check/workspace.rb +1 -1
- data/lib/takeltau/git/cli.rb +1 -1
- data/lib/takeltau/git/lib.rb +80 -0
- data/lib/takeltau/hg/cli.rb +56 -0
- data/lib/takeltau/hg/export.rb +18 -0
- data/lib/takeltau/hg/pull.rb +45 -0
- data/lib/takeltau/hg/push.rb +42 -0
- data/lib/takeltau/info/cli.rb +1 -1
- data/lib/takeltau/info/project/cli.rb +1 -1
- data/lib/takeltau/info/status/bar.rb +1 -1
- data/lib/takeltau/info/status/cli.rb +1 -1
- data/lib/takeltau/info/status/git.rb +1 -1
- data/lib/takeltau/info/status/gopass.rb +1 -1
- data/lib/takeltau/info/status/gpg.rb +1 -1
- data/lib/takeltau/info/status/lib.rb +1 -1
- data/lib/takeltau/info/status/ssh.rb +1 -1
- data/lib/takeltau/init/lib.rb +9 -28
- data/lib/takeltau/init/packer/cli.rb +4 -14
- data/lib/takeltau/init/packer/docker.rb +2 -5
- data/lib/takeltau/init/packer/templates/hgclone.tt +8 -0
- data/lib/takeltau/init/takelage/cli.rb +4 -14
- data/lib/takeltau/init/takelage/rake.rb +2 -5
- data/lib/takeltau/init/takelage/templates/hgclone.tt +2 -0
- data/lib/takeltau/lib/config.rb +2 -2
- data/lib/takeltau/lib/logging.rb +2 -2
- data/lib/takeltau/lib/project.rb +2 -2
- data/lib/takeltau/mutagen/check/cli.rb +1 -1
- data/lib/takeltau/mutagen/check/daemon.rb +1 -1
- data/lib/takeltau/mutagen/cli.rb +1 -1
- data/lib/takeltau/mutagen/socket/check.rb +1 -1
- data/lib/takeltau/mutagen/socket/cli.rb +1 -1
- data/lib/takeltau/mutagen/socket/create.rb +1 -1
- data/lib/takeltau/mutagen/socket/list.rb +1 -1
- data/lib/takeltau/mutagen/socket/terminate.rb +1 -1
- data/lib/takeltau/mutagen/socket/tidy.rb +1 -1
- data/lib/takeltau/self/cli.rb +1 -1
- data/lib/takeltau/self/config/cli.rb +1 -1
- data/lib/takeltau/self/list.rb +1 -1
- data/lib/takeltau/version +1 -1
- data/lib/takeltau.rb +37 -62
- metadata +9 -22
- data/lib/takeltau/bit/check/cli.rb +0 -23
- data/lib/takeltau/bit/check/workspace.rb +0 -37
- data/lib/takeltau/bit/cli.rb +0 -18
- data/lib/takeltau/bit/clipboard/cli.rb +0 -73
- data/lib/takeltau/bit/clipboard/copy.rb +0 -142
- data/lib/takeltau/bit/clipboard/lib.rb +0 -143
- data/lib/takeltau/bit/clipboard/paste.rb +0 -60
- data/lib/takeltau/bit/clipboard/pull.rb +0 -37
- data/lib/takeltau/bit/clipboard/push.rb +0 -37
- data/lib/takeltau/bit/require/cli.rb +0 -57
- data/lib/takeltau/bit/require/export.rb +0 -34
- data/lib/takeltau/bit/require/import.rb +0 -133
- data/lib/takeltau/bit/require/lib.rb +0 -19
- data/lib/takeltau/bit/scope/add.rb +0 -55
- data/lib/takeltau/bit/scope/cli.rb +0 -74
- data/lib/takeltau/bit/scope/list.rb +0 -41
- data/lib/takeltau/bit/scope/new.rb +0 -44
- data/lib/takeltau/bit/scope/ssh.rb +0 -13
- data/lib/takeltau/git/check/bit.rb +0 -26
- data/lib/takeltau/init/packer/templates/bitrequireyml.tt +0 -13
- data/lib/takeltau/init/takelage/templates/bitrequireyml.tt +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ac2ce1c23451d15a5964168ff53956086a3ae22c631f28aae3bb6c842beaf1ae
|
|
4
|
+
data.tar.gz: 65a90825dc3905b1e39aa17d7f2f772ae94e0457d044057133730d9a682b1647
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dd4b234874e246af2fddd7a2d947ad35e54ed1dd2da523670a5e1c2abf7fcc21e770227a10af8fb15748e8f3cdfdf414b99a448f9a2585b071df5cdb4da001e
|
|
7
|
+
data.tar.gz: 23f9c5c10ba29a7c80b90f06e22204b44575faa2a63bd9510582e76228c372500a72cc1fae1251b7c5e8d5f11756593eee65fc950deb62310fce35d672aa0ce5
|
data/lib/takeltau/default.yml
CHANGED
|
@@ -1,35 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
bit_dev_user: 'takel'
|
|
3
|
-
bit_remote: ''
|
|
4
|
-
bit_require_file: 'bitrequire.yml'
|
|
5
|
-
bit_root: '/bit'
|
|
6
|
-
bit_ssh: ''
|
|
7
|
-
cmd_bit: 'bit'
|
|
8
|
-
cmd_bit_check_workspace_bit_list: 'bit status'
|
|
9
|
-
cmd_bit_check_workspace_pwd: 'pwd'
|
|
10
|
-
cmd_bit_clipboard_lib_bit_status: 'bit status'
|
|
11
|
-
cmd_bit_clipboard_copy_bit_list_scope: 'bit list --json %{scope}'
|
|
12
|
-
cmd_bit_clipboard_copy_bit_list_remotes: 'bit remote'
|
|
13
|
-
cmd_bit_clipboard_copy_bit_add_dir: 'bit add --id %{id} --main %{dir}/README.bit %{dir}'
|
|
14
|
-
cmd_bit_clipboard_copy_bit_tag_id: 'bit tag --skip-tests %{id}'
|
|
15
|
-
cmd_bit_clipboard_copy_bit_export_to_scope: 'bit export %{scope}'
|
|
16
|
-
cmd_bit_clipboard_git_add: 'git add %{file}'
|
|
17
|
-
cmd_bit_clipboard_git_commit: 'git commit --message="%{message}"'
|
|
18
|
-
cmd_bit_clipboard_git_pull: 'git pull origin %{main}'
|
|
19
|
-
cmd_bit_clipboard_git_push: 'git push origin %{main}'
|
|
20
|
-
cmd_bit_clipboard_paste_bit_list_scope: 'bit list --json %{scope}'
|
|
21
|
-
cmd_bit_clipboard_paste_bit_import_cid: 'bit import --ignore-package-json --ignore-dist --path %{dir} %{cid}'
|
|
22
|
-
cmd_bit_clipboard_pull_bit_import_all: 'bit import --ignore-package-json --ignore-dist'
|
|
23
|
-
cmd_bit_clipboard_pull_bit_checkout_all: 'bit checkout --ignore-package-json --ignore-dist --all latest'
|
|
24
|
-
cmd_bit_clipboard_push_bit_tag_all: 'bit tag --skip-tests --all'
|
|
25
|
-
cmd_bit_clipboard_push_bit_export_all: 'bit export --all'
|
|
26
|
-
cmd_bit_clipboard_export_bit_list: 'bit list --json %{scope}'
|
|
27
|
-
cmd_bit_require_lib_bit_list: 'bit list --json'
|
|
28
|
-
cmd_bit_require_lib_bit_list_ids: 'bit list --json --ids'
|
|
29
|
-
cmd_bit_scope_add_scope: 'bit remote add %{remote}/%{scope}'
|
|
30
|
-
cmd_bit_scope_list_find_scopes: 'find -L %{root} -name scope.json'
|
|
31
|
-
cmd_bit_scope_new_bit_init: 'mkdir -p %{root}/%{scope} && cd %{root}/%{scope} && bit init --bare'
|
|
32
|
-
cmd_bit_scope_remove_scope: 'rm --force --recursive %{root}/%{scope}'
|
|
33
2
|
cmd_docker: 'docker'
|
|
34
3
|
cmd_docker_check_daemon_docker_info: 'docker info'
|
|
35
4
|
cmd_docker_container_check_existing_docker_ps: 'docker ps --filter name=^%{container}$ --quiet'
|
|
@@ -51,9 +20,16 @@ cmd_git: 'git'
|
|
|
51
20
|
cmd_git_check_clean_git_unstaged: 'git diff --exit-code'
|
|
52
21
|
cmd_git_check_clean_git_uncommitted: 'git diff --cached --exit-code'
|
|
53
22
|
cmd_git_check_clean_git_status: 'git status --porcelain'
|
|
54
|
-
|
|
23
|
+
cmd_git_check_hg_get_git_branch: 'git symbolic-ref HEAD'
|
|
55
24
|
cmd_git_check_workspace_git_repo: 'git -C %{dir} rev-parse'
|
|
56
25
|
cmd_git_check_workspace_pwd: 'pwd'
|
|
26
|
+
cmd_git_lib_git_add_all: 'git add --all'
|
|
27
|
+
cmd_git_lib_git_commit: 'git commit --message="%{message}"'
|
|
28
|
+
cmd_git_lib_git_pull_origin: 'git pull origin %{main}'
|
|
29
|
+
cmd_git_lib_git_push_origin: 'git push origin %{main}'
|
|
30
|
+
cmd_hg_export_repos: 'cd %{root}; find * -type d -name ".hg" | parallel hg paths default -R {//} -T "hg\ clone\ {url}\ " \; echo {//}'
|
|
31
|
+
cmd_hg_pull_repos: 'cd %{root}; find * -type d -name ".hg" -print0 | parallel -0 echo \; cd {//} \; pwd \; hg pull \; hg update'
|
|
32
|
+
cmd_hg_push_repos: 'cd %{root}; find * -type d -name ".hg" -print0 | parallel -0 echo \; cd {//} \; pwd \; hg add \; hg commit -m "Update\ hg\ repos" \; hg bookmark -f main \; hg push'
|
|
57
33
|
cmd_info_status_lib_git_name: 'git -C %{root} config user.name'
|
|
58
34
|
cmd_info_status_lib_git_email: 'git -C %{root} config user.email'
|
|
59
35
|
cmd_info_status_lib_git_signingkey: 'git -C %{root} config user.signingKey'
|
|
@@ -63,10 +39,10 @@ cmd_info_status_gpg_agent: 'gpg-connect-agent /bye'
|
|
|
63
39
|
cmd_info_status_gpg_keys: 'gpg --list-keys'
|
|
64
40
|
cmd_info_status_ssh_keys: 'ssh-add -l'
|
|
65
41
|
cmd_info_status_ssh_socket: 'gpgconf --list-dirs agent-ssh-socket'
|
|
66
|
-
cmd_init_lib_bit_init: 'bit init'
|
|
67
42
|
cmd_init_lib_git_init: 'git init && git checkout -b main'
|
|
68
43
|
cmd_init_lib_git_add_all: 'git add --all'
|
|
69
44
|
cmd_init_lib_git_commit_initial: 'git commit -m "Initial commit"'
|
|
45
|
+
cmd_init_lib_hg_clone: 'bash hgclone'
|
|
70
46
|
cmd_mutagen: 'mutagen'
|
|
71
47
|
cmd_mutagen_check_daemon_host_connection: 'mutagen forward list --label-selector="%{hostlabel}"'
|
|
72
48
|
cmd_mutagen_check_daemon_version: 'mutagen version'
|
|
@@ -84,10 +60,9 @@ docker_run_options: '--env GOOGLE_APPLICATION_CREDENTIALS=/hostdir/.google/defau
|
|
|
84
60
|
docker_shm_size: '512M'
|
|
85
61
|
docker_tag: 'latest'
|
|
86
62
|
docker_user: 'takelwerk'
|
|
87
|
-
|
|
63
|
+
git_hg_branch: 'main'
|
|
88
64
|
info_project_main: 'project.yml'
|
|
89
65
|
info_project_private: 'private/project.yml'
|
|
90
|
-
init_bit_require_import: 'true'
|
|
91
66
|
login_wait_for_sockets: '0'
|
|
92
67
|
mutagen_socket_path_mutagen: '~/.mutagen/daemon/daemon.sock'
|
|
93
68
|
mutagen_socket_path_gpg: '~/.gnupg/S.gpg-agent'
|
data/lib/takeltau/docker/cli.rb
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Takeltau
|
|
4
|
-
#
|
|
4
|
+
# tau git check
|
|
5
5
|
class GitCheck < SubCommandBase
|
|
6
6
|
include LoggingModule
|
|
7
7
|
include SystemModule
|
|
8
8
|
include ConfigModule
|
|
9
9
|
include GitCheckClean
|
|
10
|
-
include
|
|
10
|
+
include GitCheckHg
|
|
11
11
|
include GitCheckWorkspace
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
# git check bit
|
|
15
|
-
#
|
|
16
|
-
desc 'bit', 'Check if we are on the git bit branch'
|
|
17
|
-
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
|
18
|
-
Check if we are on the git bit branch
|
|
19
|
-
LONGDESC
|
|
20
|
-
# Check if we are on the git bit branch.
|
|
21
|
-
def bit
|
|
22
|
-
exit git_check_bit
|
|
23
|
-
end
|
|
24
|
-
|
|
25
13
|
#
|
|
26
14
|
# git check clean
|
|
27
15
|
#
|
|
@@ -34,6 +22,18 @@ module Takeltau
|
|
|
34
22
|
exit git_check_clean
|
|
35
23
|
end
|
|
36
24
|
|
|
25
|
+
#
|
|
26
|
+
# git check hg
|
|
27
|
+
#
|
|
28
|
+
desc 'hg', 'Check if we are on the git hg branch'
|
|
29
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
|
30
|
+
Check if we are on the git hg branch
|
|
31
|
+
LONGDESC
|
|
32
|
+
# Check if we are on the git hg branch.
|
|
33
|
+
def hg
|
|
34
|
+
exit git_check_hg
|
|
35
|
+
end
|
|
36
|
+
|
|
37
37
|
#
|
|
38
38
|
# git check workspace
|
|
39
39
|
#
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# tau git check hg
|
|
4
|
+
module GitCheckHg
|
|
5
|
+
# Backend method for git check hg.
|
|
6
|
+
# @return [Boolean] are we on the git hg branch?
|
|
7
|
+
def git_check_hg
|
|
8
|
+
log.debug 'Check if we are on the git hg branch'
|
|
9
|
+
|
|
10
|
+
return false unless git_check_workspace
|
|
11
|
+
|
|
12
|
+
branch = _git_check_hg_get_branch
|
|
13
|
+
log.debug "We are on git branch \"#{branch}\""
|
|
14
|
+
|
|
15
|
+
branch == config.active['git_hg_branch']
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
private
|
|
19
|
+
|
|
20
|
+
# Get git branch.
|
|
21
|
+
def _git_check_hg_get_branch
|
|
22
|
+
cmd_get_branch =
|
|
23
|
+
config.active['cmd_git_check_hg_get_git_branch']
|
|
24
|
+
(run cmd_get_branch).chomp.split('/')[-1]
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/takeltau/git/cli.rb
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# tau git lib
|
|
4
|
+
module GitLib
|
|
5
|
+
# Pull git workspace.
|
|
6
|
+
def git_lib_pull_workspace
|
|
7
|
+
log.info 'Pulling git workspace'
|
|
8
|
+
|
|
9
|
+
_git_lib_git_pull_origin_hg
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Push git workspace.
|
|
13
|
+
def git_lib_push_workspace(message)
|
|
14
|
+
log.info 'Pushing git workspace'
|
|
15
|
+
|
|
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
|
|
19
|
+
|
|
20
|
+
_git_lib_git_push_origin_hg
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
private
|
|
24
|
+
|
|
25
|
+
# git add all.
|
|
26
|
+
def _git_lib_git_add_all
|
|
27
|
+
log.debug 'Adding all files to git'
|
|
28
|
+
|
|
29
|
+
cmd_git_add_all = config.active['cmd_git_lib_git_add_all']
|
|
30
|
+
|
|
31
|
+
return true if try cmd_git_add_all
|
|
32
|
+
|
|
33
|
+
log.error 'Unable to add all files to git'
|
|
34
|
+
false
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# git commit.
|
|
38
|
+
def _git_lib_git_commit(message)
|
|
39
|
+
log.debug "Committing to git with message \"#{message}\""
|
|
40
|
+
|
|
41
|
+
cmd_git_commit = format(
|
|
42
|
+
config.active['cmd_git_lib_git_commit'],
|
|
43
|
+
message: message
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return true if try cmd_git_commit
|
|
47
|
+
|
|
48
|
+
log.error 'Unable to commit to git'
|
|
49
|
+
false
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# git pull origin hg.
|
|
53
|
+
def _git_lib_git_pull_origin_hg
|
|
54
|
+
log.info 'Pulling git hg branch from origin'
|
|
55
|
+
cmd_git_lib_git_pull_origin = format(
|
|
56
|
+
config.active['cmd_git_lib_git_pull_origin'],
|
|
57
|
+
main: config.active['git_hg_branch']
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
return true if (try cmd_git_lib_git_pull_origin).exitstatus.zero?
|
|
61
|
+
|
|
62
|
+
log.error 'Unable to pull git hg branch'
|
|
63
|
+
false
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# git push origin hg.
|
|
67
|
+
def _git_lib_git_push_origin_hg
|
|
68
|
+
log.debug 'Pushing git hg branch to origin'
|
|
69
|
+
|
|
70
|
+
cmd_git_lib_git_push_origin = format(
|
|
71
|
+
config.active['cmd_git_lib_git_push_origin'],
|
|
72
|
+
main: config.active['git_hg_branch']
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
return true if (try cmd_git_lib_git_push_origin).exitstatus.zero?
|
|
76
|
+
|
|
77
|
+
log.error 'Unable to push git hg branch'
|
|
78
|
+
false
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Takeltau
|
|
4
|
+
# tau hg
|
|
5
|
+
class Hg < SubCommandBase
|
|
6
|
+
include LoggingModule
|
|
7
|
+
include SystemModule
|
|
8
|
+
include ConfigModule
|
|
9
|
+
include GitCheckClean
|
|
10
|
+
include GitCheckHg
|
|
11
|
+
include GitCheckWorkspace
|
|
12
|
+
include GitLib
|
|
13
|
+
include HgExport
|
|
14
|
+
include HgPull
|
|
15
|
+
include HgPush
|
|
16
|
+
|
|
17
|
+
#
|
|
18
|
+
# hg export
|
|
19
|
+
#
|
|
20
|
+
desc 'export', 'Export hg repos'
|
|
21
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
|
22
|
+
Export hg repos
|
|
23
|
+
LONGDESC
|
|
24
|
+
# Export hg repos.
|
|
25
|
+
def export
|
|
26
|
+
hgclone = hg_export
|
|
27
|
+
exit false if hgclone == false
|
|
28
|
+
say hgclone
|
|
29
|
+
true
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# hg pull
|
|
34
|
+
#
|
|
35
|
+
desc 'pull', 'Pull hg repos'
|
|
36
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
|
37
|
+
Pull hg repos
|
|
38
|
+
LONGDESC
|
|
39
|
+
# Pull hg repos.
|
|
40
|
+
def pull
|
|
41
|
+
exit hg_pull
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
#
|
|
45
|
+
# hg push
|
|
46
|
+
#
|
|
47
|
+
desc 'push', 'Push hg repos'
|
|
48
|
+
long_desc <<-LONGDESC.gsub("\n", "\x5")
|
|
49
|
+
Push hg repos
|
|
50
|
+
LONGDESC
|
|
51
|
+
# Push hg repos.
|
|
52
|
+
def push
|
|
53
|
+
exit hg_push
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# tau hg export
|
|
4
|
+
module HgExport
|
|
5
|
+
# Backend method for hg export.
|
|
6
|
+
def hg_export
|
|
7
|
+
log.debug 'Export hg repos'
|
|
8
|
+
|
|
9
|
+
return false unless configured? %w[project_root_dir]
|
|
10
|
+
|
|
11
|
+
cmd_hg_export_repos = format(
|
|
12
|
+
config.active['cmd_hg_export_repos'],
|
|
13
|
+
root: config.active['project_root_dir']
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
run cmd_hg_export_repos
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# tau hg pull
|
|
4
|
+
module HgPull
|
|
5
|
+
# Backend method for hg pull.
|
|
6
|
+
# rubocop:disable Metrics/MethodLength
|
|
7
|
+
def hg_pull
|
|
8
|
+
log.debug 'Pull hg repos'
|
|
9
|
+
|
|
10
|
+
return false unless configured? %w[project_root_dir]
|
|
11
|
+
|
|
12
|
+
unless git_check_hg
|
|
13
|
+
log.error 'Not on git hg branch'
|
|
14
|
+
return false
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
unless git_check_clean
|
|
18
|
+
log.error 'No clean git workspace'
|
|
19
|
+
return false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
unless git_lib_pull_workspace
|
|
23
|
+
log.error 'Unable to pull git workspace'
|
|
24
|
+
return false
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
_hg_pull_hg_pull_repos
|
|
28
|
+
end
|
|
29
|
+
# rubocop:enable Metrics/MethodLength
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
# Pull hg repos.
|
|
34
|
+
def _hg_pull_hg_pull_repos
|
|
35
|
+
cmd_hg_pull_repos = format(
|
|
36
|
+
config.active['cmd_hg_pull_repos'],
|
|
37
|
+
root: config.active['project_root_dir']
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return true if try cmd_hg_pull_repos
|
|
41
|
+
|
|
42
|
+
log.error 'Unable to pull hg repos'
|
|
43
|
+
false
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# tau hg push
|
|
4
|
+
module HgPush
|
|
5
|
+
# Backend method for hg push.
|
|
6
|
+
# rubocop:disable Metrics/MethodLength
|
|
7
|
+
def hg_push
|
|
8
|
+
log.debug 'Push hg repos'
|
|
9
|
+
|
|
10
|
+
return false unless configured? %w[project_root_dir]
|
|
11
|
+
|
|
12
|
+
unless git_check_hg
|
|
13
|
+
log.error 'Not on git hg branch'
|
|
14
|
+
return false
|
|
15
|
+
end
|
|
16
|
+
|
|
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
|
|
28
|
+
end
|
|
29
|
+
# rubocop:enable Metrics/MethodLength
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
# Push hg repos.
|
|
34
|
+
def _hg_push_hg_push_repos
|
|
35
|
+
cmd_hg_push_repos = format(
|
|
36
|
+
config.active['cmd_hg_push_repos'],
|
|
37
|
+
root: config.active['project_root_dir']
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
run cmd_hg_push_repos
|
|
41
|
+
end
|
|
42
|
+
end
|
data/lib/takeltau/info/cli.rb
CHANGED