Skip to content

Commit 69c9d78

Browse files
committed
Revert "Revert "Revert "Fancy --sub_dir and --keep_hash (#1262)"""
New, this time real alarm. Reverting. This reverts commit 0efe2bc.
1 parent 0efe2bc commit 69c9d78

File tree

8 files changed

+37
-353
lines changed

8 files changed

+37
-353
lines changed

README.asciidoc

+3-11
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,13 @@ To check links before you merge your changes:
231231
into the master branch of the `elasticsearch` repo, run:
232232
+
233233
----------------------------
234-
./docs/build_docs --all --target_repo [email protected]:elastic/built-docs.git \
235-
--open --keep_hash --sub_dir elasticsearch:master:./elasticsearch
234+
./docs/build_docs --all --target_repo [email protected]:elastic/built-docs.git --open --sub_dir elasticsearch:master:./elasticsearch
236235
----------------------------
237236

238-
NOTE: If there are no outstanding changes in the `../elasticsearch` directory
239-
then this will build against the result of merging the last successful
240-
docs build and the contents of `../elasticsearch`. If there *are*
241-
outstanding changes then it'll just build against the contents of
242-
`../elasticsearch`.
243-
244-
To run a full build to mimic the website build, omit the `--sub_dir` and
245-
`--keep_hash` options:
237+
To run a full build to mimic the website build, omit the `--sub_dir` option:
246238

247239
----------------------------
248-
./build_docs --all --target_repo [email protected]:elastic/built-docs.git --open
240+
build_docs --all --target_repo [email protected]:elastic/built-docs.git --open
249241
----------------------------
250242

251243
The first time you run a full build is slow as it needs to:

build_docs.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ sub init_repos {
607607
tracker => $tracker,
608608
url => $url,
609609
reference => $reference_dir,
610-
keep_hash => $Opts->{keep_hash} || 0,
610+
keep_hash => $Opts->{keep_hash},
611611
);
612612
delete $child_dirs{ $repo->git_dir->absolute };
613613

@@ -644,7 +644,7 @@ sub init_repos {
644644
ES::DocsRepo->new(
645645
tracker => $tracker,
646646
dir => $conf->{docs} || '/docs_build',
647-
keep_hash => $Opts->{keep_hash} || 0
647+
keep_hash => $Opts->{keep_hash}
648648
);
649649

650650
return $tracker;

integtest/spec/all_books_change_detection_spec.rb

+2-5
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ def chapter(index)
401401
before_second_build: lambda do |src, config|
402402
repo = src.repo 'repo'
403403
repo.write 'dummy', 'dummy'
404-
repo.commit 'dummy'
405404

406405
config.extra do |conversion|
407406
conversion.keep_hash.sub_dir(repo, 'master')
@@ -620,9 +619,7 @@ def chapter(index)
620619
book = src.book 'Test'
621620
book.source repo2, 'not_used_actually'
622621
repo = src.repo 'repo'
623-
repo.switch_to_new_branch 'subbed'
624622
repo.write 'index.asciidoc', TWO_CHAPTERS + "\nmore words"
625-
repo.commit 'sub'
626623
config.extra do |conversion|
627624
conversion.keep_hash.sub_dir(repo, 'master')
628625
end
@@ -725,9 +722,9 @@ def self.add_branch(src)
725722
context 'the second build' do
726723
let(:out) { outputs[1] }
727724
include_examples 'commits changes'
728-
it "doesn't print that it is building any branch" do
725+
it "doesn't print that it is building the original branch" do
729726
# The original book hasn't changed so we don't rebuild it
730-
expect(out).not_to include('Test: Building')
727+
expect(out).not_to include('Test: Building master...')
731728
end
732729
end
733730
end

integtest/spec/all_books_sub_dir_spec.rb

-210
This file was deleted.

integtest/spec/helper/repo.rb

-7
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ def switch_to_new_branch(new_branch)
9393
##
9494
# Checks out a branch.
9595
def switch_to_branch(branch)
96-
# TODO: rename to checkout?
9796
Dir.chdir @root do
9897
sh "git checkout #{branch}"
9998
end
@@ -140,12 +139,6 @@ def push_to(dest)
140139
end
141140
end
142141

143-
def merge(ref)
144-
Dir.chdir @root do
145-
sh "git merge #{ref}"
146-
end
147-
end
148-
149142
def copy_shared_conf
150143
FileUtils.mkdir_p @root
151144
sh "cp -r /docs_build/shared #{@root}"

lib/ES/BaseRepo.pm

-13
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,6 @@ sub _reference_args {
141141
return ();
142142
}
143143

144-
#===================================
145-
# Write a sparse checkout config for the repo.
146-
#===================================
147-
sub _write_sparse_config {
148-
#===================================
149-
my ( $self, $root, $config ) = @_;
150-
151-
my $dest = $root->subdir( '.git' )->subdir( 'info' )->file( 'sparse-checkout' );
152-
open(my $sparse, '>', $dest) or dir("Couldn't write sparse config");
153-
print $sparse $config;
154-
close $sparse;
155-
}
156-
157144
#===================================
158145
sub name { shift->{name} }
159146
sub git_dir { shift->{git_dir} }

0 commit comments

Comments
 (0)