writes commits to the releasenotes file by appending to the end
555559
def _write_commits_to_release_notes(self):
        
        with open(self.release_file, 'a') as out:
            out.write("==========\n{}\n".format(self.tag))
            for commit in self.commits:
                try:
                    msg = commit[1]
                    if msg != "cosmetic":
                        out.write("-" + msg + "\n")
                except:
                    pass
1107516
public void commit(ICommitChanges changes, boolean incrementVersions, Runnable r) {
        beginWrite();

        try {
            checkForConcurrentModifications(changes, incrementVersions);

            saveChanges(changes);
            
            if (r != null) {
                r.run();
            }
        } finally {
            endWrite();
        }
    }
591748
def append_to_file(file_name, line_data):
    """"""
    with open(file_name, mode='a', encoding='utf-8') as f1:
        f1.write(line_data)
        f1.write("\n")
482460
def status
      puts "Gergich DB: #{draft.db_file}"
      unless anything_to_publish?
        puts "Nothing to publish"
        return
      end

      info = commit.info
      puts "Project: #{info[:project]}"
      puts "Branch: #{info[:branch]}"
      puts "Revision: #{info[:revision_id]} (##{commit.revision_number})"
      puts "ChangeId: #{commit.change_id}"
      puts "Files:"
      puts "  #{commit.files.join("\n  ")}"

      puts
      review_info[:labels].each do |name, score|
        puts "#{name}: #{score}"
      end

      puts
      puts "Cover Message:"
      puts cover_message

      return if review_info[:comments].empty?

      puts
      puts "Inline Comments:"
      puts

      review_info[:comments].each do |file, comments|
        comments.each do |comment|
          puts "#{file}:#{comment[:line] || comment[:range]['start_line']}\n#{comment[:message]}"
        end
      end
    end
767274
public void commit ()
        throws PersistenceException
    {
        // only write ourselves out if we've changed
        if (_storedTileSetID == _nextTileSetID) {
            return;
        }

        try {
            BufferedWriter bout = new BufferedWriter(new FileWriter(_mapfile));
            // write out our metadata
            String tline = "" + _nextTileSetID;
            bout.write(tline, 0, tline.length());
            bout.newLine();
            // write out our mappings
            writeMapFile(bout, _map);
            bout.close();

        } catch (IOException ioe) {
            String errmsg = "Failure writing map file.";
            throw new PersistenceException(errmsg, ioe);
        }
    }
523459
protected function onAfterWrite() {
        parent::onAfterWrite();
        
        //Write the snippet version record
        if(!empty($this->Text)) {
            $version=new SnippetVersion();
            $version->Text=$this->Text;
            $version->ParentID=$this->ID;
            $version->write();
        }
    }
180859
def _close_writable(self):
        
        # Wait segments upload completion
        for segment in self._write_futures:
            segment['etag'] = segment['etag'].result()

        # Upload manifest file
        with _handle_client_exception():
            self._client.put_object(self._container, self._object_name, _dumps(
                self._write_futures), query_string='multipart-manifest=put')
104641
public void writeCloseFunction(Writer writer) throws IOException {
		writer.append(TAB).append(CLOSEBRACE).append(CR);
	}
699153
protected void endPersistence(final BufferedWriter writer) throws IOException {
        // Append any additional users to the end of the file.
        for (Object currentKey : toSave.keySet()) {
            String key = (String) currentKey;
            if (!key.contains(DISABLE_SUFFIX_KEY)) {
                writeProperty(writer, key, null);
            }
        }

        toSave = null;
    }
651855
def append_note http, new_notes
      # If I don't include hours it gets reset.
      # This doens't appear to be the case for task and project.
      (self.notes << "\n#{new_notes}").lstrip!
      http.post "daily/update/#{id}", notes:notes, hours:hours
    end
898552
static void writePatch(final Patch rollbackPatch, final File file) throws IOException {
        final File parent = file.getParentFile();
        if (!parent.isDirectory()) {
            if (!parent.mkdirs() && !parent.exists()) {
                throw PatchLogger.ROOT_LOGGER.cannotCreateDirectory(file.getAbsolutePath());
            }
        }
        try {
            try (final OutputStream os = new FileOutputStream(file)){
                PatchXml.marshal(os, rollbackPatch);
            }
        } catch (XMLStreamException e) {
            throw new IOException(e);
        }
    }
916497
def append_line(filename, **line):
    
    global lock

    data = json.dumps(line, separators=(',', ':')) + '\n'
    with lock:
        with file(filename, 'a') as fp:
            fp.seek(0, SEEK_END)
            fp.write(data)
173519
protected void processCommits(Pipeline pipeline, List<Commit> commits) {
		// TODO when processing commits should we only add the commits that are within the time boundaries?
    	Set<String> seenRevisionNumbers = new HashSet<>();
    	
    	if (logger.isDebugEnabled()) {
    		StringBuilder sb = new StringBuilder();
    		sb.append("\n===== Commit List =====\n");
    		for (Commit commit : commits) {
    			sb.append("    - " + commit.getId() + " (" + commit.getScmRevisionNumber() + ") - " + commit.getScmCommitLog() + "\n");
    		}
    		
    		logger.debug(sb.toString());
    	}
    	
    	for (Commit commit : commits) {
    		boolean commitNotSeen = seenRevisionNumbers.add(commit.getScmRevisionNumber());
    		
    		if (commitNotSeen) {
    			pipeline.addCommit(PipelineStage.COMMIT.getName(), new PipelineCommit(commit, commit.getScmCommitTimestamp()));
    		}
		}
    }
806345
def commit(self, cont = False):
        

        self.journal.close()
        self.journal = None
        os.remove(self.j_file)

        for itm in os.listdir(self.tmp_dir): os.remove(cpjoin(self.tmp_dir, itm))

        if cont is True: self.begin()
1201493
function writeblobs(data, cb) {
    var ab = asyncbuilder(cb);
    var reqQ = new Queue( { concurrency: 5 } );

    u.each(data, function(file) {
      var append = ab.asyncAppend();
      var blob = { encoding: file.buffer ? 'base64' : 'utf-8',
                   content: file.buffer ? file.buffer.toString('base64') : (file.text || '') };

      reqQ.push(function(reqDone) {
        post(self.endpoint + '/git/blobs', blob, function(err, ghblob) {
          if (ghblob) { file.sha = ghblob.sha; }
          append(err, file);
          reqDone();
        });
      });

    });
    ab.complete();
  }
746847
function finishRelease() {

  log.done();
  execSync("npm run examples", {stdio: "inherit"});
  execSync("npm run docs", {stdio: "inherit"});
  let commits = "", releaseUrl = "", zipSize = 0;

  log.timer("compiling release notes");
  execAsync("git log --pretty=format:'* %s (%h)' `git describe --tags --abbrev=0`...HEAD")
    .then(stdout => {
      commits = stdout;
      log.timer("publishing npm package");
      return execAsync("npm publish ./");
    })
    .then(() => {
      log.timer("commiting all modified files for release");
      return execAsync("git add --all");
    })
    .then(() => execAsync(`git commit -m \"compiles v${version}\"`))
    .then(() => {
      log.timer("tagging latest commit");
      return execAsync(`git tag v${version}`);
    })
    .then(() => {
      log.timer("pushing to repository");
      return execAsync("git push origin --follow-tags");
    })
    .then(() => {
      log.timer("publishing release notes");
      github.authenticate({type: "oauth", token});
      return github.repos.createRelease({
        owner: "d3plus",
        repo: name,
        tag_name: `v${version}`,
        name: `v${version}`,
        body: commits,
        prerelease
      });
    })
    .then(() => {
      log.timer("attaching .zip distribution to release");
      return github.repos.getReleaseByTag({
        owner: "d3plus",
        repo: name,
        tag: `v${version}`
      });
    })
    .then(release => {
      releaseUrl = release.data.upload_url;
      zipSize = fs.statSync(`build/${name}.zip`).size;

      return github.repos.uploadAsset({
        url: releaseUrl,
        file: fs.createReadStream(`build/${name}.zip`),
        contentType: "application/zip",
        contentLength: zipSize,
        name: `${name}.zip`,
        label: `${name}.zip`,
        owner: "d3plus",
        repo: name
      });

    })
    .then(() => {
      log.exit();
      shell.exit(0);
    })
    .catch(err => {
      log.fail(err);
      log.exit();
      shell.exit(1);
    });

}
580798
private void writeInfoPlist( File infoPlist, List files )
        throws MojoExecutionException
    {

        VelocityContext velocityContext = new VelocityContext();

        velocityContext.put( "mainClass", mainClass );
        velocityContext.put( "cfBundleExecutable", javaApplicationStub.getName());
        velocityContext.put( "vmOptions", vmOptions);
        velocityContext.put( "bundleName", bundleName );

        velocityContext.put( "iconFile", iconFile == null ? "GenericJavaApp.icns" : iconFile.getName() );

        velocityContext.put( "version", version );

        velocityContext.put( "jvmVersion", jvmVersion );

        StringBuffer jarFilesBuffer = new StringBuffer();

        jarFilesBuffer.append( "<array>" );
        for ( int i = 0; i < files.size(); i++ )
        {
            String name = (String) files.get( i );
            jarFilesBuffer.append( "<string>" );
            jarFilesBuffer.append( "$JAVAROOT/" ).append( name );
            jarFilesBuffer.append( "</string>" );

        }
        if ( additionalClasspath != null )
        {
            for ( int i = 0; i < additionalClasspath.size(); i++ )
            {
                String pathElement = (String) additionalClasspath.get( i );
                jarFilesBuffer.append( "<string>" );
                jarFilesBuffer.append( pathElement );
                jarFilesBuffer.append( "</string>" );

            }
        }
        jarFilesBuffer.append( "</array>" );

        velocityContext.put( "classpath", jarFilesBuffer.toString() );

        try
        {

            String encoding = detectEncoding(dictionaryFile, velocityContext);

            getLog().debug( "Detected encoding " + encoding + " for dictionary file " +dictionaryFile  );

            Writer writer = new OutputStreamWriter( new FileOutputStream(infoPlist), encoding );

            velocity.getEngine().mergeTemplate( dictionaryFile, encoding, velocityContext, writer );

            writer.close();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Could not write Info.plist to file " + infoPlist, e );
        }
        catch ( ParseErrorException e )
        {
            throw new MojoExecutionException( "Error parsing " + dictionaryFile, e );
        }
        catch ( ResourceNotFoundException e )
        {
            throw new MojoExecutionException( "Could not find resource for template " + dictionaryFile, e );
        }
        catch ( MethodInvocationException e )
        {
            throw new MojoExecutionException(
                "MethodInvocationException occured merging Info.plist template " + dictionaryFile, e );
        }
        catch ( Exception e )
        {
            throw new MojoExecutionException( "Exception occured merging Info.plist template " + dictionaryFile, e );
        }

    }