hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
e283a309b22f963861f8965c0a98a9024e6e04cd
diff --git a/container/core.py b/container/core.py index <HASH>..<HASH> 100644 --- a/container/core.py +++ b/container/core.py @@ -119,7 +119,7 @@ def cmdrun_build(base_path, project_name, engine_name, var_file=None, if engine_obj.service_is_running('conductor'): engine_obj.stop_container(conductor_container_id, forcefully=True) - if not kwargs.get('devel'): + if conductor_container_id is None or not kwargs.get('devel'): if engine_obj.CAP_BUILD_CONDUCTOR: conductor_img_id = engine_obj.build_conductor_image( base_path,
Build conductor if none exists in `--devel` mode If `--devel` is used but the conductor is not built, ansible-container fails right now. With this patch, we'll autobuild the conductor even if the user has specified devel mode which would normally skip that step.
ansible_ansible-container
train
py
366a971c1bb2c84ccb055a36f0a4542e6c6c81aa
diff --git a/code/libraries/koowa/template/filter/alias.php b/code/libraries/koowa/template/filter/alias.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/template/filter/alias.php +++ b/code/libraries/koowa/template/filter/alias.php @@ -32,7 +32,6 @@ class KTemplateFilterAlias extends KTemplateFilterAbstract implements KTemplateF '@template(' => '$this->loadIdentifier(', '@route(' => '$this->getView()->createRoute(', '@escape(' => '$this->getView()->escape(', - '@toolbar(' => '$this->renderHelper(\'toolbar.render\'', ); /**
Removed @toolbar() alias for the time being.
joomlatools_joomlatools-framework
train
php
991ed2c2b13acd3721279fcdfe3e37ba3410a828
diff --git a/middleware/fileStore.js b/middleware/fileStore.js index <HASH>..<HASH> 100644 --- a/middleware/fileStore.js +++ b/middleware/fileStore.js @@ -22,7 +22,7 @@ module.exports = function (options) { }, responseExists: function (url) { - return fs.exists(this.filename(url)) + return fs.exists(this.filename(url) + '.json') }, writeResponse: function (url, response) { @@ -38,11 +38,10 @@ module.exports = function (options) { return fs .mkdirs(path) .then(function () { - return fs.writeFile(filename + '.json', responseJson) - }) - .then(function () { writeStreamToFile(filename, fileStream).catch(function (e) { console.error((e && e.stack) || e) + }).then(function () { + return fs.writeFile(filename + '.json', responseJson) }) response.body = responseStream
file cache: write header file after request is finished
featurist_httpism
train
js
b48ee02bdf3537db9c6b3f5540005454a904d034
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -7,7 +7,6 @@ class PagesController < AlchemyController caches_action( :show, - :layout => false, :cache_path => proc { url_for(:action => :show, :urlname => params[:urlname], :lang => multi_language? ? params[:lang] : nil) }, :if => proc do if Alchemy::Config.get(:cache_pages)
Fixes page caching. Closes #<I>
AlchemyCMS_alchemy_cms
train
rb
9229cc144897f6235efb6ccfb43e17f5291bbe7b
diff --git a/test/term_buffer.js b/test/term_buffer.js index <HASH>..<HASH> 100644 --- a/test/term_buffer.js +++ b/test/term_buffer.js @@ -100,14 +100,14 @@ describe('TermBuffer', function() { }); it("resize correctly to smaller size", function() { var t = newTermBuffer(80,24); - t.write("line1\n"); + t.write("line1\n"); t.resize(2,2); - t.write("ab\n"); + t.write("ab\n"); expect(t.toString()).to.be("ab\n"); }); it("resize correctly to bigger size", function() { var t = newTermBuffer(80,24); - t.write("line1\n"); + t.write("line1\n"); t.resize(80,28); expect(t.toString()).to.be("\n\n\n\nline1"); });
using tabs for indention.
Gottox_terminal.js
train
js
209b1d182d44c62787deb4d9e468248ba0777366
diff --git a/quilt/patch.py b/quilt/patch.py index <HASH>..<HASH> 100644 --- a/quilt/patch.py +++ b/quilt/patch.py @@ -20,8 +20,9 @@ # 02110-1301 USA import os +import os.path -from quilt.utils import Process +from quilt.utils import Process, Directory, File class Patch(object): @@ -41,3 +42,24 @@ class Patch(object): cmd.append(patch_file) Process(cmd).run(cwd=cwd) + + +class RollbackPatch(object): + + def __init__(self, cwd, backup_dir): + self.cwd = Directory(cwd) + self.backup_dir = Directory(backup_dir) + (dirs, files) = self.backup_dir.content() + + for dir in dirs: + newdir = self.cwd + dir + if not newdir.exists(): + newdir.create() + + for file in files: + file = File(file) + backup_file = self.backup_dir + file + rollback_file = self.cwd + file + if rollback_file.exists(): + rollback_file.delete() + backup_file.link(rollback_file)
Add a RollbackPatch class The RollbackPatch class that hard links the backup file created by patch to the file that should be restored.
bjoernricks_python-quilt
train
py
f03bade382a1c39caf50e1d42b5633cdd193356c
diff --git a/code/photini/metadata_gexiv2.py b/code/photini/metadata_gexiv2.py index <HASH>..<HASH> 100644 --- a/code/photini/metadata_gexiv2.py +++ b/code/photini/metadata_gexiv2.py @@ -30,7 +30,7 @@ class MetadataHandler(object): return self._md.save_file(self._path) def get_tags(self): - return self._md.get_tags() + return self._md.get_exif_tags() + self._md.get_iptc_tags() + self._md.get_xmp_tags() def get_exif_tags(self): return self._md.get_exif_tags()
Bug fix: some versions of gexiv2 don't have get_tags method.
jim-easterbrook_Photini
train
py
b943b59b4d6312bd38f5a6291f07fcbcd902285f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -225,6 +225,12 @@ function prepare(options, context, ns, hxmlContent, jsTempFile) { } } + if (name == '--macro') { + // quote macro value + args.push(`"${value}"`); + continue; + } + args.push(value); } }
Macro with single quotes need to be quoted
jasononeil_webpack-haxe-loader
train
js
47a8bbdada5df49900be01f18bbf8b852f293edb
diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -570,18 +570,11 @@ class Form implements \IteratorAggregate, FormInterface } foreach ($this->children as $name => $child) { - if (!isset($submittedData[$name])) { - $submittedData[$name] = null; - } + $child->bind(isset($submittedData[$name]) ? $submittedData[$name] : null); + unset($submittedData[$name]); } - foreach ($submittedData as $name => $value) { - if ($this->has($name)) { - $this->children[$name]->bind($value); - } else { - $this->extraData[$name] = $value; - } - } + $this->extraData = $submittedData; // If the form is compound, the default data in view format // is reused. The data of the children is merged into this
[Form] optimized the binding of child forms and calculation of extra data
symfony_symfony
train
php
93644b7c58bbcd94ed364500d26ad0d694d4f937
diff --git a/src/util.js b/src/util.js index <HASH>..<HASH> 100644 --- a/src/util.js +++ b/src/util.js @@ -289,7 +289,7 @@ const util = { */ printDebug: function (str) { if (debugMode) { - console.log(str); + console.log('[OpenPGP.js debug]', str); } }, @@ -300,7 +300,7 @@ const util = { */ printDebugError: function (error) { if (debugMode) { - console.error(error); + console.error('[OpenPGP.js debug]', error); } },
`printDebug`: add label to identify source of the log (#<I>)
openpgpjs_openpgpjs
train
js
399c7a107d7f8c57329abfed481f78a0ed828bd1
diff --git a/app/helpers/tenon/asset_helper.rb b/app/helpers/tenon/asset_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/tenon/asset_helper.rb +++ b/app/helpers/tenon/asset_helper.rb @@ -6,7 +6,15 @@ module Tenon else i = image_tag(default_asset_thumbnail(asset)) end - link_to(i, [:edit, asset], default_options) + asset_icon_link(asset, i) + end + + def asset_icon_link(asset, icon) + if asset.is_image? + link_to(icon, [:crop, asset], crop_options(asset)) + else + link_to(icon, asset.attachment.url, target: '_') + end end def default_asset_thumbnail(asset) @@ -19,6 +27,16 @@ module Tenon private + def crop_options(asset) + { + class: 'asset-crop', + data: { + 'asset-id' => asset.id, + 'post-crop-handler' => 'Tenon.features.AssetListPostCropHandler' + } + } + end + def default_options { 'data-modal-remote' => true,
Make the image load the crop view rather than the edit title window
factore_tenon
train
rb
0211bd166d1754cb9ea6eb0dfba458a8ce31521c
diff --git a/src/Hander.php b/src/Hander.php index <HASH>..<HASH> 100644 --- a/src/Hander.php +++ b/src/Hander.php @@ -17,4 +17,38 @@ namespace SlaxWeb\Cache; */ abstract class Handler { + /** + * Write + * + * Write data to cache with the given name and data. The data must be in the + * string format. + * + * @param string $name Data name + * @param string $data Data to cache + * @return self + */ + abstract public function write(string $name, string $data): Handler; + + /** + * Data exists + * + * Checks if the data exists in the cache and retuns a bool value. + * + * @param string $name Data name + * @return bool + */ + abstract public function exists(string $name): bool; + + /** + * Get data + * + * Gets the data from the cache based on the received name. If data is not found + * a 'CachedDataNotFoundException' is thrown. + * + * @param string $name Data name + * @return string + * + * @exceptions \SlaxWeb\Cache\Exception\CachedDataNotFoundException + */ + abstract public function get(string $name): string; }
add basic abstract methods to the abstract handler
SlaxWeb_Cache
train
php
0e6b02ed45a63f817b257ee8aba1a317050cb713
diff --git a/particles/utils.py b/particles/utils.py index <HASH>..<HASH> 100644 --- a/particles/utils.py +++ b/particles/utils.py @@ -189,16 +189,15 @@ def distribute_work(f, inputs, outputs=None, nprocs=1, out_key='output'): def distinct_seeds(k): - """ returns k distinct seeds for random number generation + """generates k distinct seeds for random number generation. """ - seeds = [] - for _ in range(k): - while True: - s = random.randint(MAX_INT_32) - if s not in seeds: - break - seeds.append(s) - return seeds + while(True): + seeds = random.randint(MAX_INT_32, size=2 * k) # birthday's problem + unique_seeds = np.unique(seeds) + if len(unique_seeds) >= k: + break + random.shuffle(unique_seeds) + return(unique_seeds[:k]) class seeder(object):
faster implementation of distinct_seeds in utils
nchopin_particles
train
py
92aa5a6e6f56c268d114596e5228f741a41167be
diff --git a/cursorcontext.go b/cursorcontext.go index <HASH>..<HASH> 100644 --- a/cursorcontext.go +++ b/cursorcontext.go @@ -134,6 +134,8 @@ func (ti *token_iterator) extract_struct_type() string { if !ti.go_back() { return "" } + } else if ti.token().tok == token.COMMA { + return ti.extract_struct_type() } if ti.token().tok != token.IDENT { return ""
Better cursor context deduction for array of structs literals. <URL>
nsf_gocode
train
go
c2c5173fb7af76f1506ac58b44297fe91746c8cd
diff --git a/lib/rib/runner.rb b/lib/rib/runner.rb index <HASH>..<HASH> 100644 --- a/lib/rib/runner.rb +++ b/lib/rib/runner.rb @@ -74,7 +74,7 @@ module Rib::Runner puts(Rib::VERSION) exit - when /[^-]+/ + when /^[^-]/ load_command(arg) else
runner.rb: fixed command detecting
godfat_rib
train
rb
99f7191368693c0c38f4da6713f8a826771f811d
diff --git a/lib/mongoid/reloading.rb b/lib/mongoid/reloading.rb index <HASH>..<HASH> 100644 --- a/lib/mongoid/reloading.rb +++ b/lib/mongoid/reloading.rb @@ -24,7 +24,8 @@ module Mongoid changed_attributes.clear apply_defaults reload_relations - run_callbacks(:initialize) + run_callbacks(:find) unless _find_callbacks.empty? + run_callbacks(:initialize) unless _initialize_callbacks.empty? self end diff --git a/spec/mongoid/callbacks_spec.rb b/spec/mongoid/callbacks_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongoid/callbacks_spec.rb +++ b/spec/mongoid/callbacks_spec.rb @@ -107,6 +107,21 @@ describe Mongoid::Callbacks do from_db.impressions.should eq(1) end end + + context "when the document is reloaded" do + + let(:from_db) do + Player.find(player.id) + end + + before do + from_db.reload + end + + it "executes the callback" do + from_db.impressions.should eq(1) + end + end end context "when the callback is on an embedded document" do
Ensure reload calls after_find callbacks. [ close #<I> ]
mongodb_mongoid
train
rb,rb
feb469a5792205f3b9a1f87b293c9bab9e019353
diff --git a/pyemu/en.py b/pyemu/en.py index <HASH>..<HASH> 100644 --- a/pyemu/en.py +++ b/pyemu/en.py @@ -214,6 +214,7 @@ class Ensemble(pd.DataFrame): """ df = kwargs.pop("df") assert isinstance(df,pd.DataFrame) + df.columns = [c.lower() for c in df.columns] mean_values = kwargs.pop("mean_values",df.mean(axis=0)) e = cls(data=df,index=df.index,columns=df.columns, mean_values=mean_values,**kwargs)
cast column names to lower in ensemble from_dataframe
jtwhite79_pyemu
train
py
1df1e02820b17d08d29354567f06c943ef0089a0
diff --git a/mod/bigbluebuttonbn/classes/local/proxy/bigbluebutton_proxy.php b/mod/bigbluebuttonbn/classes/local/proxy/bigbluebutton_proxy.php index <HASH>..<HASH> 100644 --- a/mod/bigbluebuttonbn/classes/local/proxy/bigbluebutton_proxy.php +++ b/mod/bigbluebuttonbn/classes/local/proxy/bigbluebutton_proxy.php @@ -80,7 +80,10 @@ class bigbluebutton_proxy extends proxy_base { if (!is_null($createtime)) { $data['createTime'] = $createtime; } - + $currentlang = current_language(); + if (!empty(trim($currentlang))) { + $data['userdata-bbb_override_default_locale'] = $currentlang; + } return self::action_url('join', $data); }
MDL-<I> mod_bigbluebuttonbn: align language with user's preference * Pick BBB UI language from Moodle user profile language instead of preferred browser language
moodle_moodle
train
php
14d0c1130684bd407c745f1760ce0c3ffb603cc9
diff --git a/src/python/turicreate/test/test_one_shot_object_detector.py b/src/python/turicreate/test/test_one_shot_object_detector.py index <HASH>..<HASH> 100644 --- a/src/python/turicreate/test/test_one_shot_object_detector.py +++ b/src/python/turicreate/test/test_one_shot_object_detector.py @@ -125,7 +125,7 @@ class OneObjectDetectorSmokeTest(unittest.TestCase): def test_create_with_single_image(self): image = self.train[0][self.feature] model = tc.one_shot_object_detector.create( - image, 'custom_logo', backgrounds=self.backgrounds) + image, 'custom_logo', backgrounds=self.backgrounds, max_iterations=1) def test_create_with_missing_value(self): sf = self.train.append(tc.SFrame({self.feature: tc.SArray([None], dtype=tc.Image), self.target: [self.train[self.target][0]]}))
accelerate OSOD unit test (#<I>)
apple_turicreate
train
py
9c3f76c059fcb8464bc53e8c0fe9b338d29c3bec
diff --git a/scrypture.py b/scrypture.py index <HASH>..<HASH> 100644 --- a/scrypture.py +++ b/scrypture.py @@ -37,7 +37,7 @@ registered_scripts = [ 'quick_hash', 'convert_epoch_time', 'file_hash', -'curl_to_requests_ui' +#'curl_to_requests' ]
disabled curl_to_requests
mosesschwartz_scrypture
train
py
7383395eaecdcc96519a8e82967d0d5611ebc37b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ module.exports = { rulesConfig: { "no-async-in-loops": 1, "no-commented-tests": 0, + "no-ok-equality": 1, "resolve-async": 2 } };
Added default rule configuration for no-ok-equality.
platinumazure_eslint-plugin-qunit
train
js
7e113ff6c5d4f8c13c06a89a0f8cb3fa446fb063
diff --git a/lib/styleguide.js b/lib/styleguide.js index <HASH>..<HASH> 100644 --- a/lib/styleguide.js +++ b/lib/styleguide.js @@ -244,7 +244,7 @@ function jsonSections(sections) { experimental: section.experimental(), reference: section.reference(), markup: section.markup() ? section.markup().toString() : null - } + } }); }
Preserve undefined and false markup() results
SC5_sc5-styleguide
train
js
aa9b7d482c96f84f11a40af07b18327919b2ac22
diff --git a/lib/cf/version.rb b/lib/cf/version.rb index <HASH>..<HASH> 100644 --- a/lib/cf/version.rb +++ b/lib/cf/version.rb @@ -1,3 +1,3 @@ module CF - VERSION = "4.1.0rc1".freeze + VERSION = "4.1.0rc2".freeze end
Bump to <I>rc2
cloudfoundry-attic_cf
train
rb
b05b2b552b9c3b6d904b3d6d313b11ac9bb76fb2
diff --git a/lib/appsignal.rb b/lib/appsignal.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal.rb +++ b/lib/appsignal.rb @@ -222,15 +222,9 @@ module Appsignal # Sets the log level and sets the logger. Uses a file-based logger or the # STDOUT-based logger. See the `:log` configuration option. # - # @param path_arg [nil] Deprecated param. Use the `:log_path` - # configuration option instead. # @return [void] # @since 0.7.0 - def start_logger(path_arg = nil) - if path_arg - logger.info("Setting the path in start_logger has no effect anymore, set it in the config instead") - end - + def start_logger if config && config[:log] == "file" && config.log_file_path start_file_logger(config.log_file_path) else
Remove deprecated `path_arg` argument from Appsignal.start_logger Part of #<I>.
appsignal_appsignal-ruby
train
rb
ee48015996d12bedd0a8438e0345b37179388cfb
diff --git a/capi_experimental/deployment.go b/capi_experimental/deployment.go index <HASH>..<HASH> 100644 --- a/capi_experimental/deployment.go +++ b/capi_experimental/deployment.go @@ -97,6 +97,10 @@ var _ = CapiExperimentalDescribe("deployment", func() { Expect(deploymentGuid).ToNot(BeEmpty()) webishProcessType := fmt.Sprintf("web-deployment-%s", deploymentGuid) + secondDeploymentGuid := CreateDeployment(appGuid) + Expect(secondDeploymentGuid).ToNot(BeEmpty()) + secondWebishProcessType := fmt.Sprintf("web-deployment-%s", secondDeploymentGuid) + Eventually(func() int { guid := GetProcessGuidForType(appGuid, "web") Expect(guid).ToNot(BeEmpty()) @@ -107,6 +111,10 @@ var _ = CapiExperimentalDescribe("deployment", func() { return GetProcessGuidForType(appGuid, webishProcessType) }).Should(BeEmpty()) + Eventually(func() string { + return GetProcessGuidForType(appGuid, secondWebishProcessType) + }).Should(BeEmpty()) + Eventually(func() int { guid := GetProcessGuidForType(appGuid, "web") Expect(guid).ToNot(BeEmpty())
Test the "deployment train" scenario in ZDT deployment test Tests the happy-path scenario where two deployments for the same app are occurring simultaneously [finishes #<I>]
cloudfoundry_cf-acceptance-tests
train
go
21279275150535514b774c8f4084b1425ecd851b
diff --git a/src/adapters/aol.js b/src/adapters/aol.js index <HASH>..<HASH> 100644 --- a/src/adapters/aol.js +++ b/src/adapters/aol.js @@ -85,6 +85,7 @@ var AolAdapter = function AolAdapter() { return { adContainerId: _dummyUnit(bid.params.adContainerId), + server: bid.params.server, // By default, DAC.js will use the US region endpoint (adserver.adtechus.com) sizeid: bid.params.sizeId, pageid: bid.params.pageId, secure: false,
Supporting adtech endpoint customization
prebid_Prebid.js
train
js
514c684023abf41917b814b09daa661de65198e7
diff --git a/mode/nsis/nsis.js b/mode/nsis/nsis.js index <HASH>..<HASH> 100644 --- a/mode/nsis/nsis.js +++ b/mode/nsis/nsis.js @@ -71,7 +71,7 @@ CodeMirror.defineSimpleMode("nsis",{ {regex: /[-+\/*=<>!]+/, token: "operator"}, // Variable - {regex: /\$\w[\w\.]+/, token: "variable"}, + {regex: /\$\w[\w\.]*/, token: "variable"}, // Constant {regex: /\${[\!\w\.:-]+}/, token: "variable-2"},
[nsis mode] improve variable pattern Follow-up to #<I> to support single letter variable names
codemirror_CodeMirror
train
js
b1b9e0ee1230ec2ac577e7c3805531fc96efb486
diff --git a/lib/action_kit_api/page.rb b/lib/action_kit_api/page.rb index <HASH>..<HASH> 100644 --- a/lib/action_kit_api/page.rb +++ b/lib/action_kit_api/page.rb @@ -2,16 +2,21 @@ require 'action_kit_api' class ActionKitApi class PageFactory - end - - class Page < PageFactory + def create(name) + end + def self.find_by_name(name) + Page.new end def self.find_by_id(id) + Page.new end + end - def self.valid? + class Page < PageFactory + def valid? + return true end end end
Fleshed out Page and PageFactory just enough to get cucumber to pass
Democracy-for-America_ActionKitApi
train
rb
9b67be70c3227473f35846be68ab8658f3debdf8
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -295,7 +295,8 @@ function getLink(response, link) { var pred = function(resource) { return resource.sys.type === type && resource.sys.id === id; }; - return _.find(response.items, pred) || _.find(response.includes[type], pred); + return _.find(response.items, pred) || + response.includes && _.find(response.includes[type], pred); } function walkMutate(input, pred, mutator) {
Fix responses which don't have includes
contentful_contentful.js
train
js
93132638be8f78e8ae89422b2dcf92072a420ca4
diff --git a/fbo.js b/fbo.js index <HASH>..<HASH> 100644 --- a/fbo.js +++ b/fbo.js @@ -4,8 +4,6 @@ var Texture = require( './texture' ); /** * @class * @param {WebGLRenderingContext} gl the webgl context this Fbo belongs to - * @param {uint} width initial width of the fbo, the size can be later changed using Fbo#resize() - * @param {uint} height initial height of the fbo, the size can be later changed using Fbo#resize() * @param {Object} [opts] * @param {boolean} [opts.depth=false] if true, a depth renderbuffer is attached * @param {boolean} [opts.stencil=false] if true, a stencil renderbuffer is attached
fixed Fbo ctor doc
plepers_nanogl
train
js
8bcc27a16992d7837601e02448740f88613ffa3f
diff --git a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java index <HASH>..<HASH> 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java +++ b/handler/src/main/java/io/netty/handler/ssl/ReferenceCountedOpenSslEngine.java @@ -1972,10 +1972,16 @@ public class ReferenceCountedOpenSslEngine extends SSLEngine implements Referenc private SSLEngineResult.HandshakeStatus mayFinishHandshake(SSLEngineResult.HandshakeStatus status) throws SSLException { - if (status == NOT_HANDSHAKING && handshakeState != HandshakeState.FINISHED) { - // If the status was NOT_HANDSHAKING and we not finished the handshake we need to call - // SSL_do_handshake() again - return handshake(); + if (status == NOT_HANDSHAKING) { + if (handshakeState != HandshakeState.FINISHED) { + // If the status was NOT_HANDSHAKING and we not finished the handshake we need to call + // SSL_do_handshake() again + return handshake(); + } + if (!isDestroyed() && SSL.bioLengthNonApplication(networkBIO) > 0) { + // We have something left that needs to be wrapped. + return NEED_WRAP; + } } return status; }
Ensure we always wrap if there is something left to be send to the remote peer (#<I>) Motivation: We need to ensure we call wrap as long as there is something left to be send to the remote peer in cases of non-application data (like for example alerts). Modifications: Check the pending data and based on it return NEED_WRAP even when the handshake was done. Result: Always produce alerts etc
netty_netty
train
java
2a8be3f38ac7c06bcf574a9383bfa7c7e9f52421
diff --git a/lib/preact.rb b/lib/preact.rb index <HASH>..<HASH> 100644 --- a/lib/preact.rb +++ b/lib/preact.rb @@ -49,14 +49,12 @@ module Preact logger.error "[Preact] No event specified, not logging event" return nil end - - person = configuration.convert_to_person(user).as_json if event.is_a?(String) preact_event = ActionEvent.new({ :name => event, :timestamp => Time.now.to_f - }).as_json + }) elsif event.is_a?(Hash) preact_event = ActionEvent.new(event) elsif !event.is_a?(ActionEvent) @@ -67,8 +65,10 @@ module Preact # attach the account info to the event preact_event.account = configuration.convert_to_account(account).as_json end + + person = configuration.convert_to_person(user) - send_log(person, preact_event) + send_log(person.as_json, preact_event.as_json) end def update_person(user)
fixed issue with string event_name + account
preact_preact-ruby
train
rb
8dc28df697a568b2afc792cab7e1f821c0e213fe
diff --git a/test/test_git_deploy.go b/test/test_git_deploy.go index <HASH>..<HASH> 100644 --- a/test/test_git_deploy.go +++ b/test/test_git_deploy.go @@ -119,10 +119,9 @@ func (s *GitDeploySuite) runBuildpackTest(t *c.C, name string, resources []strin t.Assert(push, Succeeds) t.Assert(push, OutputContains, "Creating release") t.Assert(push, OutputContains, "Application deployed") + t.Assert(push, OutputContains, "Added default web=1 formation") t.Assert(push, OutputContains, "* [new branch] master -> master") - t.Assert(r.flynn("scale", "web=1"), Succeeds) - route := name + ".dev" newRoute := r.flynn("route", "add", "http", route) t.Assert(newRoute, Succeeds)
test: Remove unnecessary scale after git push The receiver already adds a web=1 formation, so the scale command after the push always exits with "requested scale equals current scale, nothing to do!".
flynn_flynn
train
go
a274ab506888fcb696a56c135fce867048414253
diff --git a/lib/rom/adapter/sequel.rb b/lib/rom/adapter/sequel.rb index <HASH>..<HASH> 100644 --- a/lib/rom/adapter/sequel.rb +++ b/lib/rom/adapter/sequel.rb @@ -9,7 +9,8 @@ module ROM attr_reader :connection def self.schemes - [:sqlite, :jdbc] + %i(ado amalgalite cubrid db2 dbi do fdbsql firebird ibmdb informix jdbc + mysql mysql2 odbc openbase oracle postgres sqlanywhere sqlite swift tinytds) end def initialize(*args) diff --git a/spec/unit/rom/adapter/sequel_spec.rb b/spec/unit/rom/adapter/sequel_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/rom/adapter/sequel_spec.rb +++ b/spec/unit/rom/adapter/sequel_spec.rb @@ -12,4 +12,13 @@ describe Adapter::Sequel do end end end + + describe ".schemes" do + it "returns a list of schemes supported by Sequel" do + schemes = %i(ado amalgalite cubrid db2 dbi do fdbsql firebird ibmdb informix jdbc + mysql mysql2 odbc openbase oracle postgres sqlanywhere sqlite swift tinytds) + + expect(described_class.schemes).to eq schemes + end + end end
Add support for all Sequel-backed RDBMS Closes #<I>
rom-rb_rom
train
rb,rb
02c9ef1c84d4a29e9af3a169ea0eed6a8ec26f65
diff --git a/Kwf/Model/Iterator/Packages.php b/Kwf/Model/Iterator/Packages.php index <HASH>..<HASH> 100644 --- a/Kwf/Model/Iterator/Packages.php +++ b/Kwf/Model/Iterator/Packages.php @@ -33,6 +33,7 @@ class Kwf_Model_Iterator_Packages implements Iterator $s->limit($this->_packageSize, $this->_currentOffset); $this->_currentOffset += $this->_packageSize; //$this->_innerIterator->getModel()->clearRows(); + Kwf_Model_Abstract::clearAllRows(); $this->_innerIterator->rewind(); $ret = $this->_innerIterator->valid(); }
clear rows in packages iterator it's the whole point of this iterator to use less memory
koala-framework_koala-framework
train
php
e1176b7a71d559ad445f4e6cd1db146cb45dcb06
diff --git a/src/main/java/net/jodah/failsafe/AsyncExecution.java b/src/main/java/net/jodah/failsafe/AsyncExecution.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/jodah/failsafe/AsyncExecution.java +++ b/src/main/java/net/jodah/failsafe/AsyncExecution.java @@ -36,8 +36,6 @@ public final class AsyncExecution<R> extends AbstractExecution<R> { // The outer-most function that executions begin with private Function<AsyncExecution<R>, CompletableFuture<ExecutionResult>> outerFn; private final boolean asyncExecution; - // Whether a policy executor completed post execution - private final boolean[] policyPostExecuted; final FailsafeFuture<R> future; // Per-attempt state -- @@ -45,6 +43,8 @@ public final class AsyncExecution<R> extends AbstractExecution<R> { volatile boolean recordCalled; // The future for the thread that the innerFn is running in volatile Future<?> innerFuture; + // Whether a policy executor completed post execution + private final boolean[] policyPostExecuted; AsyncExecution(List<Policy<R>> policies, Scheduler scheduler, FailsafeFuture<R> future, boolean asyncExecution, Function<AsyncExecution<R>, CompletableFuture<ExecutionResult>> innerFn) {
Clarify that AsyncExecution.policyPostExecuted is per-attempt state
jhalterman_failsafe
train
java
8ecaa79d77828692101035c4204d952a48ac5252
diff --git a/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java b/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java +++ b/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheRecordStore.java @@ -1390,7 +1390,7 @@ public abstract class AbstractCacheRecordStore<R extends CacheRecord, CRM extend Data key = entry.getKey(); Object value = entry.getValue(); if (value != null) { - put(key, value, null, null, false, true, IGNORE_COMPLETION); + put(key, value, null, SOURCE_NOT_AVAILABLE, false, true, IGNORE_COMPLETION); keysLoaded.add(key); } }
Fixed a missing SOURCE_NOT_AVAILABLE in AbstractCacheRecordStore.loadAll()
hazelcast_hazelcast
train
java
c26ba1c58082828ddf21ed9515c0f95548fd2f4a
diff --git a/mode/css/css.js b/mode/css/css.js index <HASH>..<HASH> 100644 --- a/mode/css/css.js +++ b/mode/css/css.js @@ -54,7 +54,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) { if (/[\d.]/.test(stream.peek())) { stream.eatWhile(/[\w.%]/); return ret("number", "unit"); - } else if (stream.match(/^[^-]+-/)) { + } else if (stream.match(/^\w+-/)) { return ret("meta", "meta"); } } else if (/[,+>*\/]/.test(ch)) {
[css mode] Fixing a vendor prefix highlighting bug A more detailed problem description in issue #<I>
codemirror_CodeMirror
train
js
06d312c889ec7b628f68021ce87649712686d946
diff --git a/lib/OktaHelpers.js b/lib/OktaHelpers.js index <HASH>..<HASH> 100644 --- a/lib/OktaHelpers.js +++ b/lib/OktaHelpers.js @@ -64,8 +64,8 @@ function constructRecoveryQuestion(question, answer) { */ function constructCredentials(password, question, answer) { var credentials = {}; - credentials.password = constructPassword(password); - credentials.recovery_question = constructRecoveryQuestion(question, answer); + if(password) credentials.password = constructPassword(password); + if(question && answer) credentials.recovery_question = constructRecoveryQuestion(question, answer); return credentials; } /**
Modified Helpers --> constructCredentials to allow a credentials object containing only the password to be created as this is a valid credentials object for creating a new profile.
obviateio_okta-node
train
js
cdadd8037cad802a0d51bdb7d764d2b503d5de0e
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -39,13 +39,15 @@ module.exports = function(config, fn) { // return cached instance if (fn._questions) return fn._questions; + var cwd = app.cwd || process.cwd(); var opts = utils.merge({}, app.options, config); opts.data = app.cache.data || {}; - opts.cwd = app.cwd || process.cwd(); + opts.cwd = cwd; var Questions = app.Questions; var questions = new Questions(opts); fn._questions = questions; + questions.cwd = cwd; var data = questions.data; questions.on('ask', app.emit.bind(app, 'ask'));
ensure app.cwd is propagated onto app.questions
base_base-questions
train
js
c127491b716e46dfbf586e3044a67d0512c08b79
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index <HASH>..<HASH> 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -488,7 +488,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase `bin/rails g scaffold User name:string age:integer; bin/rails db:migrate` end - assert_match(/8 runs, 13 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`) + assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`) end end @@ -502,7 +502,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase `bin/rails g scaffold User name:string age:integer; bin/rails db:migrate` end - assert_match(/8 runs, 13 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`) + assert_match(/8 runs, 10 assertions, 0 failures, 0 errors/, `bin/rails test 2>&1`) end end
Fix more assertion counts. Follow up to e<I>f<I>.
rails_rails
train
rb
16123f1aec0545418814aec46de46477c93a8c9d
diff --git a/jax/interpreters/xla.py b/jax/interpreters/xla.py index <HASH>..<HASH> 100644 --- a/jax/interpreters/xla.py +++ b/jax/interpreters/xla.py @@ -187,7 +187,7 @@ translations[core.identity_p] = lambda c, x: x def zeros_like_translation_rule(c, x): def _zeros_like(shape): if shape.is_tuple(): - return c.Tuple(*tuple(_zeros_like(x) for x in shape.tuple_shapes())) + return c.Tuple(*(_zeros_like(x) for x in shape.tuple_shapes())) else: return c.Broadcast(c.Constant(onp.array(0, shape.element_type())), shape.dimensions())
Write *(...) rather than *tuple(...).
tensorflow_probability
train
py
72f239938d93aeaa62c16605f0cba4b8ef8020ff
diff --git a/i3ipc/i3ipc.py b/i3ipc/i3ipc.py index <HASH>..<HASH> 100644 --- a/i3ipc/i3ipc.py +++ b/i3ipc/i3ipc.py @@ -589,7 +589,7 @@ class Connection(object): def event_socket_teardown(self): if self.sub_socket: - self.sub_socket.shutdown(socket.SHUT_WR) + self.sub_socket.shutdown(socket.SHUT_RDWR) self.sub_socket = None def event_socket_poll(self):
use SHUT_RDWR for socket shutdown
acrisci_i3ipc-python
train
py
05b66c7b6aec408aee39d117b3a4b7d301ecc4b7
diff --git a/reporters/beyond_compare.go b/reporters/beyond_compare.go index <HASH>..<HASH> 100644 --- a/reporters/beyond_compare.go +++ b/reporters/beyond_compare.go @@ -1,5 +1,9 @@ package reporters +import ( + "runtime" +) + type beyondCompare struct{} // NewBeyondCompareReporter creates a new reporter for Beyond Compare 4. @@ -9,7 +13,13 @@ func NewBeyondCompareReporter() Reporter { func (s *beyondCompare) Report(approved, received string) bool { xs := []string{received, approved} - programName := "C:/Program Files/Beyond Compare 4/BComp.exe" + var programName string + switch runtime.GOOS { + case "windows": + programName = "C:/Program Files/Beyond Compare 4/BComp.exe" + case "darwin": + programName = "/Applications/Beyond Compare.app/Contents/MacOS/bcomp" + } return launchProgram(programName, approved, xs...) }
add OS X support for beyond compare
approvals_go-approval-tests
train
go
72392f6f983c38d710225481ab774290ff9e2be3
diff --git a/app/assets/javascripts/govuk_publishing_components/components/feedback.js b/app/assets/javascripts/govuk_publishing_components/components/feedback.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/govuk_publishing_components/components/feedback.js +++ b/app/assets/javascripts/govuk_publishing_components/components/feedback.js @@ -76,7 +76,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {}; this.somethingIsWrongButton.addEventListener('click', function (e) { this.timerFunction = function () { - this.timer = this.timer + 0.5 + this.timer = this.timer + 1 this.timerHoneyPot.setAttribute('value', this.timer) } this.timerInterval = setInterval(this.timerFunction.bind(this), 500)
Use integer instead of float Simplifies the implementation working with integers
alphagov_govuk_publishing_components
train
js
218907dbcb7fcd03d2f8d57c54682af7b37e11a2
diff --git a/src/angular-gridster.js b/src/angular-gridster.js index <HASH>..<HASH> 100644 --- a/src/angular-gridster.js +++ b/src/angular-gridster.js @@ -1156,10 +1156,17 @@ oldSizeX = item.sizeX, oldSizeY = item.sizeY, hasCallback = gridster.resizable && gridster.resizable.resize; - item.row = gridster.pixelsToRows(elmY, false); - item.col = gridster.pixelsToColumns(elmX, false); - item.sizeX = gridster.pixelsToColumns(elmW, true); - item.sizeY = gridster.pixelsToRows(elmH, true); + + var row = gridster.pixelsToRows(elmY, false); + var col = gridster.pixelsToColumns(elmX, false); + var sizeX = gridster.pixelsToColumns(elmW, true); + var sizeY = gridster.pixelsToRows(elmH, true); + if (gridster.pushing !== false || gridster.getItems(row, col, sizeX, sizeY, item).length === 0) { + item.row = row; + item.col = col; + item.sizeX = sizeX; + item.sizeY = sizeY; + } if ( hasCallback || item.row !== oldRow || item.col !== oldCol || item.sizeX !== oldSizeX || item.sizeY !== oldSizeY
Fix disabling pushing for resizing too
ManifestWebDesign_angular-gridster
train
js
1a06f4c90127c98c447dbf91efb5c537f2647b52
diff --git a/test/class_builder_test.rb b/test/class_builder_test.rb index <HASH>..<HASH> 100644 --- a/test/class_builder_test.rb +++ b/test/class_builder_test.rb @@ -38,13 +38,13 @@ class ClassBuilderTest < Test::Unit::TestCase context 'the find_signal method' do should 'find the signal "test" for TestObj' do - builder = GirFFI::Builder::Class.new 'Everything', 'TestObj' + builder = GirFFI::Builder::Class.new 'Regress', 'TestObj' sig = builder.find_signal 'test' assert_equal 'test', sig.name end should 'find the signal "test" for TestSubObj' do - builder = GirFFI::Builder::Class.new 'Everything', 'TestSubObj' + builder = GirFFI::Builder::Class.new 'Regress', 'TestSubObj' sig = builder.find_signal 'test' assert_equal 'test', sig.name end
Make tests in ClassBuilderTest pass by changing Everything to Regress.
mvz_gir_ffi
train
rb
bc14e2da734edd9013c0ca7afe102dc668b826dd
diff --git a/src/server/pps/persist/server/rethink_api_server.go b/src/server/pps/persist/server/rethink_api_server.go index <HASH>..<HASH> 100644 --- a/src/server/pps/persist/server/rethink_api_server.go +++ b/src/server/pps/persist/server/rethink_api_server.go @@ -363,7 +363,8 @@ func (a *rethinkAPIServer) UpdatePipelineInfo(ctx context.Context, request *pers if request.CreatedAt != nil { return nil, ErrTimestampSet } - if err := a.updateMessage(pipelineInfosTable, request); err != nil { + doc := gorethink.Expr(request).Without("CreatedAt") + if _, err := a.getTerm(pipelineInfosTable).Insert(doc, gorethink.InsertOpts{Conflict: "update"}).RunWrite(a.session); err != nil { return nil, err } return google_protobuf.EmptyInstance, nil
UpdatePipeline no longer clears CreatedAt field.
pachyderm_pachyderm
train
go
28845bf2a008a3cce1ab7e075fc851d3b7193dc6
diff --git a/shared/tooltip.js b/shared/tooltip.js index <HASH>..<HASH> 100644 --- a/shared/tooltip.js +++ b/shared/tooltip.js @@ -12,13 +12,12 @@ class UIManager { .attr("class", "tooltip") .style("font-size", "2em") .style("opacity", 0) - .style("padding", "4em"); + .style("padding", "2em"); this.stateToggle = renderer.root.append("div") .attr("class", "stateButtonDiv") .style("right" , 0) .style("bottom", 0) - .style("padding", "4em") .append("input") .attr("class", "stateButton") .attr("type", "button") @@ -60,7 +59,7 @@ class UIManager { .style("opacity", 1); this.tip .text("agent: " + d.data.label) - .style('color', d.data.color.brighter()); + .style('color', d.data.color); }
modified viz to look fit within application
Kappa-Dev_KaSim
train
js
208fb8a5906c146a8c3dc957af335221c50c6db7
diff --git a/tests/test_package.py b/tests/test_package.py index <HASH>..<HASH> 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -53,5 +53,5 @@ def test_sign_file_with_identity(monkeypatch): pkg.sign('gpg', 'identity') except IOError: pass - args = ('gpg', '--detach-sign', '-a', filename, '--local-user', 'identity') + args = ('gpg', '--detach-sign', '--local-user', 'identity', '-a', filename) assert replaced_check_call.calls == [pretend.call(args)] diff --git a/twine/package.py b/twine/package.py index <HASH>..<HASH> 100644 --- a/twine/package.py +++ b/twine/package.py @@ -143,9 +143,10 @@ class PackageFile(object): def sign(self, sign_with, identity): print("Signing {0}".format(self.basefilename)) - gpg_args = (sign_with, "--detach-sign", "-a", self.filename) + gpg_args = (sign_with, "--detach-sign") if identity: gpg_args += ("--local-user", identity) + gpg_args += ("-a", self.filename) subprocess.check_call(gpg_args) with open(self.signed_filename, "rb") as gpg:
Place --local-user and argument in middle of sign Placing --local-user and its argument after the filename makes gpg think it is the file you're trying to sign. This was re-ordered accidentally during my refacorting efforts which broke signing. Closes #<I>
pypa_twine
train
py,py
38b4137ef16328db487228dd3b019d7c3bd7ed1c
diff --git a/src/primitives.js b/src/primitives.js index <HASH>..<HASH> 100644 --- a/src/primitives.js +++ b/src/primitives.js @@ -46,7 +46,7 @@ * * example: * - * const arrays = twgl.primitives.createPlaneArrays(1); + * const arrays = twgl.primitives.createPlaneVertices(1); * twgl.primitives.reorientVertices(arrays, m4.rotationX(Math.PI * 0.5)); * const bufferInfo = twgl.createBufferInfoFromArrays(gl, arrays); *
Fix comment in primitives.js
greggman_twgl.js
train
js
2106013e7c4929d495de00a8ddb7738425a27fdd
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ setup( name='yoti', version=VERSION, packages=find_packages(), - license='OTHER', + license='MIT', description='The Yoti Python SDK, providing API support for Login, Verify (2FA) and Age Verification.', long_description=long_description, url='https://github.com/getyoti/yoti-python-sdk', @@ -24,7 +24,7 @@ setup( }, classifiers=[ 'Development Status :: 5 - Production/Stable', - 'License :: Other/Proprietary License', + 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Intended Audience :: Developers', 'Programming Language :: Python',
[SDK-<I>]: Updated setup.py after changing license
getyoti_yoti-python-sdk
train
py
f6a2daa718e49e09d394ea3c19360243d46f22df
diff --git a/lib/zyps.rb b/lib/zyps.rb index <HASH>..<HASH> 100644 --- a/lib/zyps.rb +++ b/lib/zyps.rb @@ -196,7 +196,7 @@ class Color attr_accessor :red, :green, :blue def initialize (red = 1, green = 1, blue = 1) - @red, @green, @blue = red, green, blue + self.red, self.green, self.blue = red, green, blue end #Automatically constrains value to the range 0 - 1.
Color.new was allowing channel values > 1; fixed.
jaymcgavren_zyps
train
rb
f2a9eeb12e31a0da6afb8070c6b0d8f813b6c0f1
diff --git a/mode/clike/clike.js b/mode/clike/clike.js index <HASH>..<HASH> 100644 --- a/mode/clike/clike.js +++ b/mode/clike/clike.js @@ -624,6 +624,10 @@ CodeMirror.defineMode("clike", function(config, parserConfig) { defKeywords: words("class val var object interface fun"), atoms: words("true false null this"), hooks: { + "@": function(stream) { + stream.eatWhile(/[\w\$_]/); + return "meta"; + }, '"': function(stream, state) { state.tokenize = tokenKotlinString(stream.match('""')); return state.tokenize(stream, state);
[clike] Support @-identifiers in Kotlin mode
codemirror_CodeMirror
train
js
a8ed9fefbca5932e6fdc68d7cd9b96e3707d5dad
diff --git a/kaybee/app.py b/kaybee/app.py index <HASH>..<HASH> 100644 --- a/kaybee/app.py +++ b/kaybee/app.py @@ -14,8 +14,10 @@ import dectate from kaybee.plugins.debugdumper.action import DumperAction from kaybee.plugins.events import EventAction +from kaybee.plugins.resources.action import ResourceAction class kb(dectate.App): event = dectate.directive(EventAction) dumper = dectate.directive(DumperAction) + resource = dectate.directive(ResourceAction)
@wip Forgot to add resource as an action.
pauleveritt_kaybee
train
py
eb080db0fdece2cd91271205106f66d1f937bb2d
diff --git a/src/bootstrap.php b/src/bootstrap.php index <HASH>..<HASH> 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -17,6 +17,9 @@ namespace Fuel\Common; // register the services of this composer library \Dependency::getInstance()->registerService(new ServicesProvider); +// alias helper classes to global +\Alias::alias('Fuel\Common\Str', 'Str'); + /** * FuelPHP Composer library application bootstrap */
aliased Str helper class to global
fuelphp_common
train
php
c37877961025c0d337704edbcbeda93567aa3859
diff --git a/core/src/test/java/org/acegisecurity/ui/session/HttpSessionEventPublisherTests.java b/core/src/test/java/org/acegisecurity/ui/session/HttpSessionEventPublisherTests.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/acegisecurity/ui/session/HttpSessionEventPublisherTests.java +++ b/core/src/test/java/org/acegisecurity/ui/session/HttpSessionEventPublisherTests.java @@ -32,6 +32,7 @@ import org.acegisecurity.MockApplicationContext; * The HttpSessionEventPublisher tests * * @author Ray Krueger + * @version $Id$ */ public class HttpSessionEventPublisherTests extends TestCase { //~ Methods ================================================================ @@ -90,7 +91,7 @@ public class HttpSessionEventPublisherTests extends TestCase { pub.getContext(); fail("IllegalArgumentException expected, the context is null"); } catch (IllegalArgumentException e) { - e.printStackTrace(); + assertTrue(true); } } }
Removed printStackTrace from expected exception.
spring-projects_spring-security
train
java
3e419973c16a874b89a4e9b5d1000c7d43fbe963
diff --git a/test/Utils/Flex/FlexExecCommandTest.php b/test/Utils/Flex/FlexExecCommandTest.php index <HASH>..<HASH> 100644 --- a/test/Utils/Flex/FlexExecCommandTest.php +++ b/test/Utils/Flex/FlexExecCommandTest.php @@ -125,10 +125,9 @@ class FlexExecCommandTest extends \PHPUnit_Framework_TestCase ] ); // Check the contents of the generated cloudbuild.yaml - $cloudbuild = file_get_contents("$this->workdir/cloudbuild.yaml"); - $this->assertEquals( - file_get_contents($cloudbuildYaml), - $cloudbuild + $this->assertFileEquals( + $cloudbuildYaml, + sprintf('%s/cloudbuild.yaml', $this->workdir) ); }
Use assertFileEquals (#<I>)
GoogleCloudPlatform_php-tools
train
php
0a0183308072ae0f17e719a9f20475346d911bf1
diff --git a/symphony/lib/boot/defines.php b/symphony/lib/boot/defines.php index <HASH>..<HASH> 100644 --- a/symphony/lib/boot/defines.php +++ b/symphony/lib/boot/defines.php @@ -242,15 +242,19 @@ define_safe('__SECURE__', /** * The root url directory. + * This constant will always ends with '/' + * to avoid problems when the root is simply / + * + * @since Symphony 2.7.0 * @var string */ -define_safe('DIRROOT', rtrim(dirname(server_safe('PHP_SELF')), '\/')); +define_safe('DIRROOT', rtrim(dirname(server_safe('PHP_SELF')), '\/') . '/'); /** * The current domain name. * @var string */ -define_safe('DOMAIN', HTTP_HOST . DIRROOT); +define_safe('DOMAIN', HTTP_HOST . rtrim(DIRROOT, '/')); /** * The base URL of this Symphony install, minus the symphony path.
Make sure the DIRROOT constant ends with a / This should make is easier to use it. Re: #<I> Picked from b6d9edbb<I>
symphonycms_symphony-2
train
php
4b3725d58de1a20d45ecdafef3fdac18ebdd389b
diff --git a/migrator.go b/migrator.go index <HASH>..<HASH> 100644 --- a/migrator.go +++ b/migrator.go @@ -171,8 +171,7 @@ func (m Migrator) Reset() error { // CreateSchemaMigrations sets up a table to track migrations. This is an idempotent // operation. -func (m Migrator) CreateSchemaMigrations() error { - c := m.Connection +func CreateSchemaMigrations(c *Connection) error { mtn := c.MigrationTableName() err := c.Open() if err != nil { @@ -197,6 +196,12 @@ func (m Migrator) CreateSchemaMigrations() error { }) } +// CreateSchemaMigrations sets up a table to track migrations. This is an idempotent +// operation. +func (m Migrator) CreateSchemaMigrations() error { + return CreateSchemaMigrations(m.Connection) +} + // Status prints out the status of applied/pending migrations. func (m Migrator) Status(out io.Writer) error { err := m.CreateSchemaMigrations()
feat: make CreateSchemaMigrations independent of the migrator (#<I>)
gobuffalo_pop
train
go
aa6e1650a564866075b3be02b846540c28400716
diff --git a/ceph_deploy/connection.py b/ceph_deploy/connection.py index <HASH>..<HASH> 100644 --- a/ceph_deploy/connection.py +++ b/ceph_deploy/connection.py @@ -16,8 +16,8 @@ def get_connection(hostname, username, logger, threads=5, use_sudo=None): conn = remoto.Connection( hostname, logger=logger, - sudo=use_sudo, threads=threads, + detect_sudo=True, ) # Set a timeout value in seconds to disconnect and move on
use the new sudo detection magic from remoto
ceph_ceph-deploy
train
py
4f1d857e7dee0c5cccb0e3a3e804429b52c93f31
diff --git a/aiosparql/__init__.py b/aiosparql/__init__.py index <HASH>..<HASH> 100644 --- a/aiosparql/__init__.py +++ b/aiosparql/__init__.py @@ -1,2 +1,2 @@ -__version__ = version = "0.1.1" +__version__ = version = "0.1.2" version_info = tuple([int(d) for d in version.split("-")[0].split(".")])
Bumped to version <I>
aio-libs_aiosparql
train
py
a36b90cbf85b11575e6bbaa9a0e2be8ff9da9c9d
diff --git a/docs/src/Home.js b/docs/src/Home.js index <HASH>..<HASH> 100644 --- a/docs/src/Home.js +++ b/docs/src/Home.js @@ -25,7 +25,7 @@ var Home = React.createClass({ <p>Learn Ligo in a few simple steps.</p> <Link to="hello world" className="call-to-action">Hello World</Link> <p></p> - <a href="/">Demo</a> + <a href="/demo">Demo</a> <a href="https://github.com/HewlettPackard/Ligo">GitHub</a> </Panel> </Panel>
Fixing the path for the demo app.
grommet_grommet
train
js
a9620ab918b555fc963013e7f5417dbff4e87db3
diff --git a/activeresource/test/cases/base_test.rb b/activeresource/test/cases/base_test.rb index <HASH>..<HASH> 100644 --- a/activeresource/test/cases/base_test.rb +++ b/activeresource/test/cases/base_test.rb @@ -5,6 +5,7 @@ require "fixtures/street_address" require "fixtures/beast" require "fixtures/proxy" require 'active_support/core_ext/hash/conversions' +require 'mocha' class BaseTest < Test::Unit::TestCase def setup
method_missing errors on activeresource tests, mocha is not required there [#<I> state:committed]
rails_rails
train
rb
10e0507a53ce9a0dc960dd98a887f72a62f3c14a
diff --git a/tags/image.js b/tags/image.js index <HASH>..<HASH> 100644 --- a/tags/image.js +++ b/tags/image.js @@ -16,7 +16,7 @@ steal.then(function() { */ DocumentJS.tags.image = { add: function( line ) { - var m = line.match(/^\s*@image\s*([\w\.\/]*)\s*([\w]*)\s*([\w]*)\s*(.*)/) + var m = line.match(/^\s*@image\s*([^\s]+)\s*([\w]*)\s*([\w]*)\s*(.*)/) if ( m ) { var src = m[1] ? m[1].toLowerCase() : '';
fix for images w/ special characters in them breaking
bitovi_documentjs
train
js
d9a0097ad8dce4bb7f5887cae34ef993db144c3c
diff --git a/test/units/geminabox/proxy/splicer_test.rb b/test/units/geminabox/proxy/splicer_test.rb index <HASH>..<HASH> 100644 --- a/test/units/geminabox/proxy/splicer_test.rb +++ b/test/units/geminabox/proxy/splicer_test.rb @@ -46,11 +46,6 @@ module Geminabox ) end - def test_local_file_path - expected = File.expand_path(file_name, Geminabox::Server.data) - assert_equal expected, splice.local_path - end - # This test seems unstable, and I'm not sure why. def xtest_local_file_path expected = File.expand_path(file_name, File.join(Geminabox::Server.data, 'proxy'))
Test was hidden by same name. Removing it as it seems to never pass.
geminabox_geminabox
train
rb
e43cd0d5c89bcf61421127485fe2b2864bc35894
diff --git a/cmd/utils.go b/cmd/utils.go index <HASH>..<HASH> 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -265,9 +265,9 @@ func NewCustomHTTPTransport() http.RoundTripper { Timeout: 30 * time.Second, KeepAlive: 30 * time.Second, }).DialContext, - MaxIdleConns: 100, - MaxIdleConnsPerHost: 100, - IdleConnTimeout: 90 * time.Second, + MaxIdleConns: 1024, + MaxIdleConnsPerHost: 1024, + IdleConnTimeout: 30 * time.Second, TLSHandshakeTimeout: 10 * time.Second, ExpectContinueTimeout: 1 * time.Second, TLSClientConfig: &tls.Config{RootCAs: globalRootCAs},
Increased MaxIdleConnsPerHost to prevent excessive re-connections and TIME_WAIT when more than <I> clients are using minio (#<I>)
minio_minio
train
go
8d902a6bab7b0be0e1dd898928c5e20fa384648c
diff --git a/xmantissa/test/test_stats.py b/xmantissa/test/test_stats.py index <HASH>..<HASH> 100644 --- a/xmantissa/test/test_stats.py +++ b/xmantissa/test/test_stats.py @@ -31,6 +31,18 @@ class RemoteStatsCollectorTest(BoxReceiverFactoryPowerupTestMixin, unittest.Test self.sender = CollectingSender() self.receiver.startReceivingBoxes(self.sender) + + def tearDown(self): + """ + Ensure the log observer added by L{setUp} is removed. + """ + try: + log.removeObserver(self.receiver._emit) + except ValueError: + # The test removed it already. + pass + + def test_deliverStatEvents(self): """ When a L{RemoteStatsCollector} is active, it sends AMP boxes
Merge fix-log-observers-<I> Author: exarkun Reviewer: washort Fixes: #<I> Clean up stats-related log observers at the end of the stats tests so that global state is the same before and after those tests and to avoid keeping a ton of extra data in memory for the entire test suite run.
twisted_mantissa
train
py
5811a8e848ba9ae5f8a789397b3dcb010a445b79
diff --git a/admin/index.php b/admin/index.php index <HASH>..<HASH> 100644 --- a/admin/index.php +++ b/admin/index.php @@ -350,8 +350,7 @@ /// If successful, continue upgrading roles and setting everything properly if ($status) { if (empty($CFG->rolesactive)) { - - /// Groups upgrade is now in core above. + // Groups upgrade is now in core above. // Upgrade to the roles system. moodle_install_roles(); @@ -359,13 +358,10 @@ } else if (!update_capabilities()) { print_error('cannotupgradecapabilities', 'debug'); } + // update core events events_update_definition(); - require_once($CFG->libdir.'/statslib.php'); - if (!stats_upgrade_for_roles_wrapper()) { - notify('Couldn\'t upgrade the stats tables to use the new roles system'); - } if (set_config("version", $version)) { remove_dir($CFG->dataroot . '/cache', true); // flush cache notify($strdatabasesuccess, "green");
MDL-<I> Old stats upgrade that we don't need any more
moodle_moodle
train
php
af9589bffcd413169f86351fd3fed81e135a9b0b
diff --git a/lib/model.js b/lib/model.js index <HASH>..<HASH> 100644 --- a/lib/model.js +++ b/lib/model.js @@ -459,12 +459,12 @@ assign(derived, { Object.keys(CONNECTION_STRING_OPTIONS).forEach((item) => { if (typeof this[item] !== 'undefined' && !req.query[item]) { - if (item === 'compression' && this.compression) { - if (this.compression.compressors) { + if (item === 'compression') { + if (this.compression && this.compression.compressors) { req.query.compressors = this.compression.compressors.join(','); } - if (this.compression.zlibCompressionLevel) { + if (this.compression && this.compression.zlibCompressionLevel) { req.query.zlibCompressionLevel = this.compression.zlibCompressionLevel; } } else if (item === 'authMechanismProperties') {
refactor: clean uri from an empty compression (#<I>)
mongodb-js_connection-model
train
js
aa65e9bdbf21833f543296b29b644108961decb8
diff --git a/LeanMapper/Result.php b/LeanMapper/Result.php index <HASH>..<HASH> 100644 --- a/LeanMapper/Result.php +++ b/LeanMapper/Result.php @@ -144,9 +144,6 @@ class Result implements \Iterator if (!isset($this->data[$id])) { throw new InvalidArgumentException("Missing row with ID $id."); } - if (!$this->isDetached($id) and !array_key_exists($key, $this->data[$id])) { - throw new InvalidArgumentException("Missing field '$key' in row."); - } if ($key === 'id' and !$this->isDetached($id)) { throw new InvalidArgumentException("ID can only be set in detached rows."); }
LeanMapper\Result: removed impractical obstruction in setDataEntry
Tharos_LeanMapper
train
php
06b2c49644ce3d8d8cdd40680f18d4c3e4aed6e1
diff --git a/lib/resqued/listener_proxy.rb b/lib/resqued/listener_proxy.rb index <HASH>..<HASH> 100644 --- a/lib/resqued/listener_proxy.rb +++ b/lib/resqued/listener_proxy.rb @@ -13,6 +13,14 @@ module Resqued @options = options end + # Public: wrap up all the things, this object is going home. + def dispose + if @master_socket + @master_socket.close + @master_socket = nil + end + end + # Public: An IO to select on to check if there is incoming data available. def read_pipe @master_socket @@ -80,6 +88,7 @@ module Resqued # Public: Report that a worker finished. def worker_finished(pid) + return if @master_socket.nil? @master_socket.puts(pid) end end diff --git a/lib/resqued/master.rb b/lib/resqued/master.rb index <HASH>..<HASH> 100644 --- a/lib/resqued/master.rb +++ b/lib/resqued/master.rb @@ -119,7 +119,7 @@ module Resqued @listener_backoff.finished @current_listener = nil end - listener_pids.delete(lpid) # This may leak workers. + listener_pids.delete(lpid).dispose # This may leak workers. write_procline else return
Clean up some of the listener's details.
spraints_resqued
train
rb,rb
44266d3c1c0d2fe19b3cd96df5f74debf1301db6
diff --git a/test/web/specs/getDirectoryContents.spec.js b/test/web/specs/getDirectoryContents.spec.js index <HASH>..<HASH> 100644 --- a/test/web/specs/getDirectoryContents.spec.js +++ b/test/web/specs/getDirectoryContents.spec.js @@ -114,7 +114,7 @@ describe("getDirectoryContents", function() { }); }); - it("glob filter test')", function() { + it("supports globbing files", function() { const options = { deep: true, glob: {
renamed test based on Perry's recommendation
perry-mitchell_webdav-client
train
js
aca68ade7f2aec42e746e986f501a980486eb722
diff --git a/pycbc/events/events.py b/pycbc/events/events.py index <HASH>..<HASH> 100644 --- a/pycbc/events/events.py +++ b/pycbc/events/events.py @@ -427,6 +427,7 @@ class EventManager(object): row.channel = channel row.ifo = ifo + row.chisq = event['chisq'] # FIXME: This is *not* the dof!!! # but is needed for later programs not to fail if 'chisq_dof' in event.dtype.names:
Add chisq back into code. This should have already been fixed on master
gwastro_pycbc
train
py
1b0d1c850391d602aa51d65a8c61cd07bc24d195
diff --git a/version/src/main/java/org/jboss/as/version/ProductConfig.java b/version/src/main/java/org/jboss/as/version/ProductConfig.java index <HASH>..<HASH> 100644 --- a/version/src/main/java/org/jboss/as/version/ProductConfig.java +++ b/version/src/main/java/org/jboss/as/version/ProductConfig.java @@ -124,14 +124,14 @@ public class ProductConfig implements Serializable { public String getPrettyVersionString() { if (name != null) - return String.format("JBoss %s %s (AS %s)", name, version, Version.AS_VERSION); + return String.format("JBoss %s %s (WildFly %s)", name, version, Version.AS_VERSION); return String.format("WildFly %s \"%s\"", Version.AS_VERSION, Version.AS_RELEASE_CODENAME); } public static String getPrettyVersionString(final String name, String version1, String version2) { if(name != null) { - return String.format("JBoss %s %s (AS %s)", name, version1, version2); + return String.format("JBoss %s %s (WildFly %s)", name, version1, version2); } return String.format("WildFly %s \"%s\"", version1, version2); }
Use WildFly also for layered configurations
wildfly_wildfly
train
java
12cd3b63da62e6a0c4dd8241eeb72902ee68aa7a
diff --git a/src/Illuminate/Bus/Queueable.php b/src/Illuminate/Bus/Queueable.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Bus/Queueable.php +++ b/src/Illuminate/Bus/Queueable.php @@ -47,7 +47,7 @@ trait Queueable /** * The number of seconds before the job should be made available. * - * @var \DateTimeInterface|\DateInterval|int|null + * @var \DateTimeInterface|\DateInterval|array|int|null */ public $delay; @@ -129,7 +129,7 @@ trait Queueable /** * Set the desired delay in seconds for the job. * - * @param \DateTimeInterface|\DateInterval|int|null $delay + * @param \DateTimeInterface|\DateInterval|array|int|null $delay * @return $this */ public function delay($delay)
Fix #<I> let delay() method accept array (#<I>) * Update Queueable.php let delay method accept array according to documentation> <URL>
laravel_framework
train
php
808c657369521d61b9b950d1c7af3cd81295d6a4
diff --git a/src/client/pfs.go b/src/client/pfs.go index <HASH>..<HASH> 100644 --- a/src/client/pfs.go +++ b/src/client/pfs.go @@ -395,6 +395,27 @@ func (c APIClient) PutFileWithDelimiter(repoName string, commitID string, path s return int(written), err } +// PutFileURL +func (c APIClient) PutFileURL(repoName string, commitID string, path string, url string) (retErr error) { + putFileClient, err := c.PfsAPIClient.PutFile(context.Background()) + if err != nil { + return sanitizeErr(err) + } + defer func() { + if _, err := putFileClient.CloseAndRecv(); err != nil && retErr == nil { + retErr = sanitizeErr(err) + } + }() + if err := putFileClient.Send(&pfs.PutFileRequest{ + File: NewFile(repoName, commitID, path), + FileType: pfs.FileType_FILE_TYPE_REGULAR, + Url: url, + }); err != nil { + return sanitizeErr(err) + } + return nil +} + // GetFile returns the contents of a file at a specific Commit. // offset specifies a number of bytes that should be skipped in the beginning of the file. // size limits the total amount of data returned, note you will get fewer bytes
Adds PutFileURL to the goclient.
pachyderm_pachyderm
train
go
a9673408ccae27ff3a30c4690cf7b17f04a1a91d
diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java index <HASH>..<HASH> 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java @@ -240,6 +240,10 @@ public class XmppConnectionManager<DC extends AbstractXMPPConnection> { } connections.clear(); + + if (accountRegistrationConnection != null) { + accountRegistrationConnection.disconnect(); + } }
Admin should be disconnected after tests. The Smack Integration tests can use an admin account to provision accounts that are used by the tests. This admin account uses an XMPP connection to interact with the server-under-test. When the tests are over, this account should be disconnected explicitly, to prevent stream management from keeping it alive longer than it needs to.
igniterealtime_Smack
train
java
4d5f1b92ca64e3953e0ab397556fadc193b17cdc
diff --git a/js/crypton.js b/js/crypton.js index <HASH>..<HASH> 100644 --- a/js/crypton.js +++ b/js/crypton.js @@ -404,9 +404,4 @@ module.exports = class crypton extends Exchange { } } } - - async request (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) { - let response = await this.fetch2 (path, api, method, params, headers, body); - return response['result']; - } };
removed unnecessary request override from crypton fix #<I>
ccxt_ccxt
train
js
39655c1a333b655eb9a0f114224e8050fb3c3eb3
diff --git a/src/Tapestry.php b/src/Tapestry.php index <HASH>..<HASH> 100644 --- a/src/Tapestry.php +++ b/src/Tapestry.php @@ -27,7 +27,7 @@ class Tapestry implements ContainerAwareInterface, ArrayAccess * Version Number * @var string */ - const VERSION = '1.0.3'; + const VERSION = '1.0.4'; /** * Tapestry constructor.
:bookmark: Merged fixes into development and incremented version
tapestry-cloud_tapestry
train
php
93c6ad47b4312bb6b41c27379faa570f2845da58
diff --git a/gcsproxy/mutable_content_test.go b/gcsproxy/mutable_content_test.go index <HASH>..<HASH> 100644 --- a/gcsproxy/mutable_content_test.go +++ b/gcsproxy/mutable_content_test.go @@ -296,7 +296,15 @@ func (t *DirtyTest) SetUp(ti *TestInfo) { } func (t *DirtyTest) ReadAt_CallsLease() { - AssertTrue(false, "TODO") + buf := make([]byte, 4) + const offset = 17 + + // Lease + ExpectCall(t.rwl, "ReadAt")(bufferIs(buf), offset). + WillOnce(Return(0, errors.New(""))) + + // Call + t.mc.ReadAt(buf, offset) } func (t *DirtyTest) ReadAt_LeaseFails() {
DirtyTest.ReadAt_CallsLease
jacobsa_timeutil
train
go
fc9a9120f86da19787c702ac7a7f5dfcac262b90
diff --git a/src/SourceLocator/Exception/InvalidFileInfo.php b/src/SourceLocator/Exception/InvalidFileInfo.php index <HASH>..<HASH> 100644 --- a/src/SourceLocator/Exception/InvalidFileInfo.php +++ b/src/SourceLocator/Exception/InvalidFileInfo.php @@ -6,11 +6,14 @@ class InvalidFileInfo extends \RuntimeException { /** * @param mixed $nonSplFileInfo + * * @return InvalidFileInfo */ public static function fromNonSplFileInfo($nonSplFileInfo) { - $type = is_object($nonSplFileInfo) ? get_class($nonSplFileInfo) : gettype($nonSplFileInfo) ; - return new self(sprintf('Expected an iterator of SplFileInfo instances, %s given instead', $type)); + return new self(sprintf( + 'Expected an iterator of SplFileInfo instances, %s given instead', + is_object($nonSplFileInfo) ? get_class($nonSplFileInfo) : gettype($nonSplFileInfo) + )); } }
#<I> CS (inlining expressions, docblock spacing)
Roave_BetterReflection
train
php
c5290cfec6e60e4e7f55b5c823cd56a9b0c783c6
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ from setuptools import setup, find_packages from setuptools.command.test import test as TestCommand # we only support Python 3 version >= 3.4 -if sys.version_info < (3, 4): +if len(sys.argv) >= 2 and sys.argv[1] == "install" and sys.version_info < (3, 4): raise SystemExit("Python 3.4 or higher is required")
Check python version in setup.py only for install This allow us to use this on build service like travis.
GNS3_gns3-server
train
py
b9d22ea98cf524b1e59082bdb930f0a28b5c0401
diff --git a/lib/sbdb/db.rb b/lib/sbdb/db.rb index <HASH>..<HASH> 100644 --- a/lib/sbdb/db.rb +++ b/lib/sbdb/db.rb @@ -88,6 +88,14 @@ module SBDB def self.new file, name = nil, *p, &e super file, name, RECNO, *p, &e end + + def [] k + super [k].pack('I') + end + + def []= k, v + super [k].pack('I'), v + end end Array = Recno @@ -95,5 +103,13 @@ module SBDB def self.new file, name = nil, *p, &e super file, name, QUEUE, *p, &e end + + def [] k + super [k].pack('I') + end + + def []= k, v + super [k].pack('I'), v + end end end
DB: Recno/Queue-support
ruby-bdb_sbdb
train
rb
e867fe4565c8b9c8a6dc33758f7d0dcb53fdb2dc
diff --git a/panc/src/org/quattor/pan/utils/XmlUtils.java b/panc/src/org/quattor/pan/utils/XmlUtils.java index <HASH>..<HASH> 100644 --- a/panc/src/org/quattor/pan/utils/XmlUtils.java +++ b/panc/src/org/quattor/pan/utils/XmlUtils.java @@ -30,6 +30,7 @@ public class XmlUtils { if (!factory.getFeature(SAXTransformerFactory.FEATURE)) { throw CompilerError.create(MSG_MISSING_SAX_TRANSFORMER); } + factory.setAttribute("indent-number", new Integer(4)); // Can safely cast the factory to a SAX-specific one. Get the // handler to feed with SAX events.
fix indentation for annotation files (possibly also for xml output files)
quattor_pan
train
java
75e916ecbaaa82727a6f7fb510e37971f483d9ca
diff --git a/src/Artax/Http/Client.php b/src/Artax/Http/Client.php index <HASH>..<HASH> 100644 --- a/src/Artax/Http/Client.php +++ b/src/Artax/Http/Client.php @@ -71,6 +71,7 @@ class Client { $this->contextOptions['http']['content'] = $request->getBody(); $this->contextOptions['http']['method'] = $request->getMethod(); + $this->contextOptions['http']['protocol_version'] = $request->getHttpVersion(); $context = stream_context_create( $this->contextOptions,
Added protocol_version in the request.
amphp_artax
train
php
1a69dfb648be1b0e814a338a2cdf8ac22f7cf293
diff --git a/web/concrete/src/Cache/Cache.php b/web/concrete/src/Cache/Cache.php index <HASH>..<HASH> 100644 --- a/web/concrete/src/Cache/Cache.php +++ b/web/concrete/src/Cache/Cache.php @@ -74,7 +74,9 @@ abstract class Cache */ public function enable() { - $this->pool->setDriver($this->driver); + if ($this->driver !== null) { + $this->pool->setDriver($this->driver); + } $this->enabled = true; }
Only need to set the cache driver if the driver stored is not null Former-commit-id: afaa<I>ac<I>f6aa<I>a<I>f1e<I>b6c<I>
concrete5_concrete5
train
php
3dd4e0c2001e1192127aeae1bcdabb242619674d
diff --git a/src/Propel/Generator/Command/InitCommand.php b/src/Propel/Generator/Command/InitCommand.php index <HASH>..<HASH> 100644 --- a/src/Propel/Generator/Command/InitCommand.php +++ b/src/Propel/Generator/Command/InitCommand.php @@ -166,9 +166,10 @@ class InitCommand extends AbstractCommand private function initMysql(OutputInterface $output, DialogHelper $dialog) { $host = $dialog->ask($output, 'Please enter your database host', 'localhost'); + $port = $dialog->ask($output, 'Please enter your database port', '3306'); $database = $dialog->ask($output, 'Please enter your database name'); - return sprintf('mysql:host=%s;dbname=%s', $host, $database); + return sprintf('mysql:host=%s;port=%s;dbname=%s', $host, $port, $database); } private function initSqlite(OutputInterface $output, DialogHelper $dialog)
Init command now allows you to choose mysql port
propelorm_Propel2
train
php
9922abe01f2c3ed37f3faba19d84ed9114fa9300
diff --git a/salt/modules/file.py b/salt/modules/file.py index <HASH>..<HASH> 100644 --- a/salt/modules/file.py +++ b/salt/modules/file.py @@ -2380,6 +2380,34 @@ def get_managed( ''' Return the managed file data for file.managed + name + location where the file lives on the server + + template + template format + + source + managed source file + + source_hash + hash of the source file + + user + user owner + + group + group owner + + mode + file mode + + context + variables to add to the environment + + default + default values of for context_dict + + CLI Example: .. code-block:: bash @@ -2852,6 +2880,49 @@ def manage_file(name, Checks the destination against what was retrieved with get_managed and makes the appropriate modifications (if necessary). + name + location to place the file + + sfn + location of cached file on the minion + + This is the path to the file stored on the minion. This file is placed on the minion + using cp.cache_file. If the hash sum of that file matches the source_sum, we do not + transfer the file to the minion again. + + This file is then grabbed and if it has template set, it renders the file to be placed + into the correct place on the system using salt.utils.copyfile() + + source + file reference on the master + + source_hash + sum hash for source + + user + user owner + + group + group owner + + backup + backup_mode + + makedirs + make directories if they do not exist + + template + format of templating + + show_diff + Include diff in state return + + contents: + contents to be placed in the file + + dir_mode + mode for directories created with makedirs + CLI Example: .. code-block:: bash
expand documentation around sfn This important variable is not documented anywhere else. It is the location in the cache where the minion recieves the file from the master and then templates it or just moves it into place on the minion using try: salt.utils.copyfile(sfn, real_name, __salt__['config.backup_mode'](backup), __opts__['cachedir'])
saltstack_salt
train
py
8d0d3aa02c40e323faf3bbfeef3cd71647efc7a1
diff --git a/src/Router.js b/src/Router.js index <HASH>..<HASH> 100644 --- a/src/Router.js +++ b/src/Router.js @@ -235,9 +235,7 @@ function Router(declarativeStates) { assertPathUniqueness(stateArray); - // Only leaf states can be transitioned to. - leafStates = {}; - registerLeafStates(stateArray); + leafStates = registerLeafStates(stateArray, {}); } function assertPathUniqueness(states) { @@ -258,15 +256,16 @@ function Router(declarativeStates) { for (var name in states) callback(name, states[name]); } - function registerLeafStates(states) { - states.forEach(function(state) { + function registerLeafStates(states, leafStates) { + return states.reduce(function(leafStates, state) { if (state.children.length) - registerLeafStates(state.children); + return registerLeafStates(state.children, leafStates); else { leafStates[state.fullName] = state; state.paths = util.parsePaths(state.fullPath()); + return leafStates; } - }); + }, leafStates); } /*
Quick refactoring: Less side effect
AlexGalays_abyssa-js
train
js
d89561c08f3a47f84231edb7dbda59381e267610
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -16,4 +16,20 @@ end class ActiveSupport::TestCase fixtures :all + + def self.aws_setup + paperclip_config = AnotherUploader.configuration.has_attached_file_options + @@bucket ||= paperclip_config[:bucket] + AWS.config(paperclip_config[:s3_credentials]) + AWS::S3.new + end + + def self.bucket + @@aws ||= self.aws_setup + @@aws.buckets[@@bucket] + end + + def assert_remote_file_exists path + assert self.class.bucket.objects[path].exists?, "Expected #{path} to be uploaded to bucket #{@@bucket}" + end end
added AWS query function to test_helper
betesh_another_uploader
train
rb
ef91ae206f5db14abc7cef4d8878c222bebc8e18
diff --git a/visidata/cmdlog.py b/visidata/cmdlog.py index <HASH>..<HASH> 100644 --- a/visidata/cmdlog.py +++ b/visidata/cmdlog.py @@ -17,7 +17,7 @@ BaseSheet.init('undone', list) # list of CommandLogRow for redo after undo nonLogged = '''forget exec-longname undo redo quit error status errors statuses options threads cmdlog replay stop pause cancel advance save-cmdlog -go- search scroll prev next page go start end zoom resize +go- search scroll prev next page start end zoom resize visibility suspend redraw no-op help syscopy syspaste sysopen profile toggle'''.split() option('rowkey_prefix', 'キ', 'string prefix for rowkey in the cmdlog')
[cmdlog] make visibility commands not loggable
saulpw_visidata
train
py
02292f55fdc1c6257b106bcd5f0cdf8be69857f4
diff --git a/docs/conf_std.py b/docs/conf_std.py index <HASH>..<HASH> 100644 --- a/docs/conf_std.py +++ b/docs/conf_std.py @@ -90,7 +90,7 @@ exclude_patterns = ['_build'] pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +modindex_common_prefix = ['pycbc.'] # -- Options for HTML output --------------------------------------------------- @@ -130,7 +130,7 @@ html_theme_options = {'collapsiblesidebar':True} # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. @@ -150,7 +150,7 @@ html_theme_options = {'collapsiblesidebar':True} #html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +html_split_index = True # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True
fix module index page to not include pycbc. prefix
gwastro_pycbc
train
py
ee9d8b73483c4a53dcaaff9fc6a963c8d7afc309
diff --git a/normandy/settings.py b/normandy/settings.py index <HASH>..<HASH> 100644 --- a/normandy/settings.py +++ b/normandy/settings.py @@ -399,7 +399,7 @@ class Development(Base): class Production(Base): """Settings for the production environment.""" - USE_X_FORWARDED_HOST = values.BooleanValue(True) + USE_X_FORWARDED_HOST = values.BooleanValue(False) SECURE_PROXY_SSL_HEADER = values.TupleValue(("HTTP_X_FORWARDED_PROTO", "https")) LOGGING_USE_JSON = values.Value(True) SECURE_HSTS_SECONDS = values.IntegerValue(31536000) # 1 year
Do not use X-Forwarded-Host We started stripping this header at Nginx due to <URL>
mozilla_normandy
train
py
a2348fca0ff43912812126158cd089e08ace1ce9
diff --git a/Controller/PageAdminController.php b/Controller/PageAdminController.php index <HASH>..<HASH> 100644 --- a/Controller/PageAdminController.php +++ b/Controller/PageAdminController.php @@ -580,8 +580,9 @@ class PageAdminController extends CRUDController * @throws \Symfony\Component\Security\Core\Exception\AccessDeniedException * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ - public function editAction(Request $request, $id = null) + public function editAction($id = null) { + $request = $this->getRequest(); // the key used to lookup the template $templateKey = 'edit';
make sure the edit action is compatible with the parent class
networking_init-cms-bundle
train
php
201ceee84e32bf07d97eb7954108da83c78f9d23
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -20,4 +20,14 @@ setup(name='arguments', license='GPL', packages=['arguments'], zip_safe=True, - install_requires=['docopt', 'schema', 'consoleprinter']) + install_requires=['docopt', 'schema', 'consoleprinter'], + classifiers=[ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Development Status :: Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", + "Operating System :: POSIX", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: System", + ])
pip Friday <I> March <I> (week:9 day:<I>), <I>:<I>:<I>
erikdejonge_arguments
train
py
482cf09422a0b3433f16c35934b2125e134a57a5
diff --git a/config/local.js b/config/local.js index <HASH>..<HASH> 100644 --- a/config/local.js +++ b/config/local.js @@ -7,8 +7,8 @@ module.exports = { * Current Node Information */ port: 3010, - routes: require("./endpoints/routes.js"), - events: require("./endpoints/events.js"), + routes: __dirname + "/endpoints/routes.js", + events: __dirname + "/endpoints/events.js", /** diff --git a/connections/server.js b/connections/server.js index <HASH>..<HASH> 100644 --- a/connections/server.js +++ b/connections/server.js @@ -99,8 +99,8 @@ class Server { * Apply Routes/Events after Middleware for correct order */ applyRoutes() { - blitz.config.api.routes(this.http) - blitz.config.api.events(this.sockets, this.http) + require(blitz.config.api.routes)(this.http) + require(blitz.config.api.events)(this.sockets, this.http) }
require routes on setup rather than on config
cubic-js_cubic
train
js,js
db4c81794b12f663ec21c4db461f7c0041a42f68
diff --git a/lib/cistern/attributes.rb b/lib/cistern/attributes.rb index <HASH>..<HASH> 100644 --- a/lib/cistern/attributes.rb +++ b/lib/cistern/attributes.rb @@ -135,9 +135,9 @@ module Cistern::Attributes transform = Cistern::Attributes.transforms[options[:squash] ? :squash : :none] || Cistern::Attributes.default_transform - parser = Cistern::Attributes.parsers[options[:type]] || - options[:parser] || - Cistern::Attributes.default_parser + parser = options[:parser] || + Cistern::Attributes.parsers[options[:type]] || + Cistern::Attributes.default_parser transformed = transform.call(name, value, options)
fix(attributes): always use explicit :parser
lanej_cistern
train
rb
bf56a789f9c594528d6d1c0a1f02f5195ab083e9
diff --git a/plans/models.py b/plans/models.py index <HASH>..<HASH> 100644 --- a/plans/models.py +++ b/plans/models.py @@ -260,8 +260,6 @@ class UserPlan(models.Model): def get_plan_extended_until(self, plan, pricing): if plan.is_free(): return None - if not self.plan.is_free() and self.expire is None: - return None if pricing is None: return self.expire return self.get_plan_extended_from(plan) + timedelta(days=pricing.period)
fix get_plan_extended_until() if UserPlan does not set expiry date - use today from get_plan_extended_from()
django-getpaid_django-plans
train
py
e86e75cd54373c468e5b081c8c41c47ae270e2f3
diff --git a/lxd/db/cluster/stmt.go b/lxd/db/cluster/stmt.go index <HASH>..<HASH> 100644 --- a/lxd/db/cluster/stmt.go +++ b/lxd/db/cluster/stmt.go @@ -42,11 +42,21 @@ var stmts = map[int]string{} // Statement code to statement SQL text. var PreparedStmts = map[int]*sql.Stmt{} // Stmt prepares the in-memory prepared statement for the transaction. -func Stmt(tx *sql.Tx, code int) *sql.Stmt { +func Stmt(tx *sql.Tx, code int) (*sql.Stmt, error) { stmt, ok := PreparedStmts[code] if !ok { - panic(fmt.Sprintf("No prepared statement registered with code %d", code)) + return nil, fmt.Errorf("No prepared statement registered with code %d", code) } - return tx.Stmt(stmt) + return tx.Stmt(stmt), nil +} + +// StmtString returns the in-memory query string with the given code. +func StmtString(code int) (string, error) { + stmt, ok := stmts[code] + if !ok { + return "", fmt.Errorf("No prepared statement registered with code %d", code) + } + + return stmt, nil }
lxd/db/cluster/stmt: Add StmtString and remove panics
lxc_lxd
train
go