@cplace/cli
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -1,10 +0,7 @@ | ||
# Changelog Wed Mar 15 2017 | ||
# Changelog Thu Jul 20 2017 | ||
_Commit range: 1754c7cffc737b0e4ffc8e75576a8a7cab31e797 - a9e22099f1bafb4fe0af5bbca56b782c7562fa79_ | ||
_Commit range: adedd6ba09d97a6413b2649944e4bf8a69edbf61 - 4041d83530c77c25f5925f98175a0f12894207eb_ | ||
* Improvmeent: add relevance pattern for user stories (US-xxx) | ||
* Feature: add possibility to extract default release-notes message from commit message | ||
* Feature: three-way-merge for conflict resolution | ||
* Feature: support explicit marking of commits by using explicits_<lang>.db | ||
* Feature: add repo-scripts functionality (update, clone, write) | ||
* Improvement: add new freeze option to `repos -w` in order to force writing a commit hash | ||
* Fix: do not clone using --single-branch |
@@ -37,6 +37,8 @@ #!/usr/bin/env node | ||
Updates all parent repos. | ||
If <force> is set, the update will take place even if the working copies of the parent repos are not clean. | ||
2. --write|-w: | ||
If <force> is set the update will take place even if the working copies of the parent repos are not clean. | ||
2. --write|-w [--freeze]: | ||
Write the states of the parent repos to parent-repos.json. | ||
If <force> is set, the update will take place even if the working copies of the parent repos are not clean. | ||
If <freeze> is set the exact commit hashes of the currently checked out parent repos will be written regardless | ||
whether there already was a commit hash in the descriptor or not. | ||
If <force> is set the update will take place even if the working copies of the parent repos are not clean. | ||
3. --clone|-c: | ||
@@ -43,0 +45,0 @@ Clones all parent repos if missing. <force> has no effect for this command. |
@@ -0,9 +1,13 @@ | ||
import * as Promise from 'bluebird'; | ||
import { AbstractReposCommand } from './AbstractReposCommand'; | ||
import { ICommandParameters } from '../models'; | ||
/** | ||
* General write-repos-state command | ||
*/ | ||
import * as Promise from 'bluebird'; | ||
import { AbstractReposCommand } from './AbstractReposCommand'; | ||
export declare class WriteRepos extends AbstractReposCommand { | ||
private static readonly PARAMETER_FREEZE; | ||
private freeze; | ||
execute(): Promise<void>; | ||
protected doPrepareAndMayExecute(params: ICommandParameters): boolean; | ||
private mapStatus(repo, status); | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* General write-repos-state command | ||
*/ | ||
const Promise = require("bluebird"); | ||
@@ -12,3 +9,10 @@ const fs_1 = require("../../p/fs"); | ||
const AbstractReposCommand_1 = require("./AbstractReposCommand"); | ||
/** | ||
* General write-repos-state command | ||
*/ | ||
class WriteRepos extends AbstractReposCommand_1.AbstractReposCommand { | ||
constructor() { | ||
super(...arguments); | ||
this.freeze = false; | ||
} | ||
execute() { | ||
@@ -32,8 +36,3 @@ const promises = Object | ||
const newParentRepos = {}; | ||
states.forEach((s) => { | ||
if (!this.parentRepos[s.repoName].commit) { | ||
delete s.status.commit; | ||
} | ||
newParentRepos[s.repoName] = s.status; | ||
}); | ||
states.forEach((s) => newParentRepos[s.repoName] = s.status); | ||
Global_1.Global.isVerbose() && console.log('status and revparse successfully completed'); | ||
@@ -49,2 +48,7 @@ const newParentReposContent = util_1.enforceNewline(JSON.stringify(newParentRepos, null, 2)); | ||
} | ||
doPrepareAndMayExecute(params) { | ||
this.freeze = params[WriteRepos.PARAMETER_FREEZE]; | ||
Global_1.Global.isVerbose() && this.freeze && console.log('Freezing repo states'); | ||
return true; | ||
} | ||
mapStatus(repo, status) { | ||
@@ -59,3 +63,3 @@ return repo | ||
}; | ||
if (current.commit) { | ||
if (this.freeze || current.commit) { | ||
result.commit = commit; | ||
@@ -67,4 +71,5 @@ } | ||
} | ||
WriteRepos.PARAMETER_FREEZE = 'freeze'; | ||
exports.WriteRepos = WriteRepos; | ||
//# sourceMappingURL=WriteRepos.js.map |
{ | ||
"name": "@cplace/cli", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -39,6 +39,8 @@ #!/usr/bin/env node | ||
Updates all parent repos. | ||
If <force> is set, the update will take place even if the working copies of the parent repos are not clean. | ||
2. --write|-w: | ||
If <force> is set the update will take place even if the working copies of the parent repos are not clean. | ||
2. --write|-w [--freeze]: | ||
Write the states of the parent repos to parent-repos.json. | ||
If <force> is set, the update will take place even if the working copies of the parent repos are not clean. | ||
If <freeze> is set the exact commit hashes of the currently checked out parent repos will be written regardless | ||
whether there already was a commit hash in the descriptor or not. | ||
If <force> is set the update will take place even if the working copies of the parent repos are not clean. | ||
3. --clone|-c: | ||
@@ -45,0 +47,0 @@ Clones all parent repos if missing. <force> has no effect for this command. |
@@ -1,4 +0,1 @@ | ||
/** | ||
* General write-repos-state command | ||
*/ | ||
import * as Promise from 'bluebird'; | ||
@@ -11,5 +8,12 @@ import {fs} from '../../p/fs'; | ||
import {IReposDescriptor, IRepoStatus} from './models'; | ||
import {ICommandParameters} from '../models'; | ||
/** | ||
* General write-repos-state command | ||
*/ | ||
export class WriteRepos extends AbstractReposCommand { | ||
private static readonly PARAMETER_FREEZE: string = 'freeze'; | ||
private freeze: boolean = false; | ||
public execute(): Promise<void> { | ||
@@ -35,8 +39,3 @@ const promises = Object | ||
const newParentRepos: IReposDescriptor = {}; | ||
states.forEach((s) => { | ||
if (!this.parentRepos[s.repoName].commit) { | ||
delete s.status.commit; | ||
} | ||
newParentRepos[s.repoName] = s.status; | ||
}); | ||
states.forEach((s) => newParentRepos[s.repoName] = s.status); | ||
@@ -55,2 +54,8 @@ Global.isVerbose() && console.log('status and revparse successfully completed'); | ||
protected doPrepareAndMayExecute(params: ICommandParameters): boolean { | ||
this.freeze = params[WriteRepos.PARAMETER_FREEZE] as boolean; | ||
Global.isVerbose() && this.freeze && console.log('Freezing repo states'); | ||
return true; | ||
} | ||
private mapStatus(repo: Repository, status: IGitStatus): Promise<IRepoStatus> { | ||
@@ -65,3 +70,3 @@ return repo | ||
}; | ||
if (current.commit) { | ||
if (this.freeze || current.commit) { | ||
result.commit = commit; | ||
@@ -68,0 +73,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
182377
2624