Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8941e8f

Browse files
author
Michelle Tilley
committed
Merge remote-tracking branch 'origin/master' into mkt-show-panels-on-first-run
2 parents c7ec1d4 + 8357ed4 commit 8941e8f

14 files changed

+46
-237
lines changed

lib/github-package.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -168,21 +168,10 @@ export default class GithubPackage {
168168
const activeRepository = this.getActiveRepository();
169169
const activeRepositoryPath = activeRepository ? activeRepository.getWorkingDirectoryPath() : null;
170170

171-
const resolutionProgressByPath = {};
172-
this.contextPool.withResidentContexts((workdir, context) => {
173-
const resolutionProgress = context.getResolutionProgress();
174-
if (!resolutionProgress || resolutionProgress.isEmpty()) {
175-
return;
176-
}
177-
178-
resolutionProgressByPath[workdir] = resolutionProgress.serialize();
179-
});
180-
181171
return {
182172
activeRepositoryPath,
183173
gitController: this.controller.serialize(),
184174
firstRun: false,
185-
resolutionProgressByPath,
186175
};
187176
}
188177

lib/models/conflicts/resolution-progress.js

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,7 @@ import {Emitter} from 'event-kit';
33
export default class ResolutionProgress {
44
constructor() {
55
this.emitter = new Emitter();
6-
7-
this.revision = '';
86
this.markerCountByPath = new Map();
9-
this.loaded = false;
10-
}
11-
12-
load(revision, savedState) {
13-
this.revision = revision;
14-
15-
if (savedState.revision === this.revision) {
16-
const paths = Object.keys(savedState.paths || {});
17-
paths.forEach(filePath => {
18-
this.markerCountByPath.set(filePath, savedState.paths[filePath]);
19-
});
20-
21-
if (paths.length > 0) {
22-
this.didUpdate();
23-
}
24-
}
25-
26-
this.loaded = true;
277
}
288

299
didUpdate() {
@@ -49,13 +29,4 @@ export default class ResolutionProgress {
4929
isEmpty() {
5030
return this.markerCountByPath.size === 0;
5131
}
52-
53-
serialize() {
54-
const paths = Object.create(null);
55-
for (const [path, count] of this.markerCountByPath) {
56-
paths[path] = count;
57-
}
58-
59-
return {revision: this.revision, paths};
60-
}
6132
}

lib/models/workdir-context-pool.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ export default class WorkdirContextPool {
3434
return this.getContext(directory);
3535
}
3636

37-
let savedResolutionProgress = {};
38-
if (options.resolutionProgressByPath) {
39-
savedResolutionProgress = options.resolutionProgressByPath[directory] || {};
40-
}
41-
42-
const context = new WorkdirContext(directory, {savedResolutionProgress, ...this.options, ...options});
37+
const context = new WorkdirContext(directory, {...this.options, ...options});
4338
this.contexts.set(directory, context);
4439

4540
const disposable = new CompositeDisposable();

lib/models/workdir-context.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default class WorkdirContext {
3030
this.repository = (options[createRepoSym] || (() => new Repository(directory)))();
3131

3232
const {window: theWindow, workspace, promptCallback} = options;
33-
this.savedResolutionProgress = options.savedResolutionProgress || {};
3433

3534
this.destroyed = false;
3635
this.emitter = new Emitter();
@@ -74,16 +73,13 @@ export default class WorkdirContext {
7473
* will not be complete.
7574
*/
7675
@autobind
77-
async repositoryChangedState(payload) {
76+
repositoryChangedState(payload) {
7877
if (this.destroyed) {
7978
return;
8079
}
8180

8281
if (this.repository.isPresent()) {
8382
this.observer.start().then(() => this.emitter.emit('did-start-observer'));
84-
85-
const head = await this.repository.getLastCommit();
86-
this.resolutionProgress.load(head.getSha(), this.savedResolutionProgress);
8783
} else if (this.repository.isDestroyed()) {
8884
this.emitter.emit('did-destroy-repository');
8985

lib/views/init-dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default class InitDialog extends React.Component {
6262
onClick={this.init}
6363
disabled={this.state.initDisabled}
6464
tabIndex="4">
65-
Clone
65+
Init
6666
</button>
6767
</div>
6868
</div>

lib/views/staging-view.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,9 @@ export default class StagingView {
382382
<header className="github-StagingView-header">
383383
<span className="icon icon-list-unordered" />
384384
<span className="github-StagingView-title">Unstaged Changes</span>
385-
{this.props.hasUndoHistory ? this.renderUndoButton() : null}
386385
{this.props.unstagedChanges.length ? this.renderStageAllButton() : null}
387386
</header>
387+
{this.props.hasUndoHistory ? this.renderUndoButton() : null}
388388

389389
<div ref="unstagedChanges" className="github-StagingView-list github-FilePatchListView" tabIndex="-1">
390390
{
@@ -512,7 +512,7 @@ export default class StagingView {
512512

513513
renderUndoButton() {
514514
return (
515-
<button className="github-StagingView-headerButton icon icon-history"
515+
<button className="github-StagingView-headerButton github-StagingView-headerButton--fullWidth icon icon-history"
516516
onclick={this.undoLastDiscard}>Undo Discard</button>
517517
);
518518
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"react-dom": "^15.5.4",
6565
"react-relay": "^0.10.0",
6666
"recursive-readdir": "^2.0.0",
67+
"temp": "^0.8.3",
6768
"tree-kill": "^1.1.0",
6869
"what-the-diff": "^0.3.0",
6970
"yubikiri": "1.0.0"
@@ -93,7 +94,6 @@
9394
"react-test-renderer": "^15.5.4",
9495
"simulant": "^0.2.2",
9596
"sinon": "^2.1.0",
96-
"temp": "^0.8.3",
9797
"test-until": "^1.1.1"
9898
},
9999
"consumedServices": {

styles/hunk-view.less

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141
&-line {
42-
display:flex;
42+
display: table-row;
4343
line-height: 1.5em;
4444
color: @hunk-fg-color;
4545
&.is-unchanged {
@@ -48,7 +48,8 @@
4848
}
4949

5050
&-lineNumber {
51-
flex: 0 0 3em; // TODO: Make width dynamic, currently capped at 3 chars
51+
display: table-cell;
52+
min-width: 3.5em; // min 4 chars
5253
overflow: hidden;
5354
padding: 0 .5em;
5455
text-align: right;
@@ -62,11 +63,12 @@
6263
}
6364

6465
&-lineContent {
65-
flex: 1;
66+
display: table-cell;
6667
padding: 0 .5em 0 3ch; // indent 3 characters
6768
text-indent: -2ch; // remove indentation for the +/-
6869
white-space: pre-wrap;
69-
word-wrap: break-word;
70+
word-break: break-word;
71+
width: 100%;
7072
}
7173
}
7274

styles/staging-view.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
padding: 0 @component-padding;
4040
font-weight: normal;
4141
border-left: 1px solid @panel-heading-border-color;
42+
white-space: nowrap;
4243
background: none;
4344
cursor: default;
4445

@@ -55,6 +56,11 @@
5556
font-size: 1em;
5657
text-align: left;
5758
}
59+
60+
&--fullWidth {
61+
border-left: none;
62+
border-bottom: 1px solid @panel-heading-border-color;
63+
}
5864
}
5965

6066

0 commit comments

Comments
 (0)