conflict_resolution
stringlengths
27
16k
<<<<<<< private fileIsAppointment (file: IAppointment|IForm|IQuillDelta|IWallet|File) : boolean { ======= private fileIsAppointment (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|File) : boolean { >>>>>>> private fileIsAppointment (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|IWallet|File) : boolean { <<<<<<< private fileIsDelta (file: IAppointment|IForm|IQuillDelta|IWallet|File) : boolean { ======= private fileIsDelta (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|File) : boolean { >>>>>>> private fileIsDelta (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|IWallet|File) : boolean { <<<<<<< private fileIsForm (file: IAppointment|IForm|IQuillDelta|IWallet|File) : boolean { const maybeForm = <any> file; return maybeForm.components instanceof Array; } /** @ignore */ ======= private fileIsEhrApiKey (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|File) : boolean { const maybeEhrApiKey = <any> file; return ( typeof maybeEhrApiKey.apiKey === 'string' && typeof maybeEhrApiKey.isMaster === 'boolean' ); } /** @ignore */ >>>>>>> private fileIsEhrApiKey (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|IWallet|File) : boolean { const maybeEhrApiKey = <any> file; return ( typeof maybeEhrApiKey.apiKey === 'string' && typeof maybeEhrApiKey.isMaster === 'boolean' ); } /** @ignore */ private fileIsForm (file: IAppointment|IEhrApiKey|IForm|IQuillDelta|IWallet|File) : boolean { const maybeForm = <any> file; return maybeForm.components instanceof Array; } /** @ignore */ <<<<<<< file: IQuillDelta|IQuillDelta[]|File|IAppointment|IForm|IWallet, ======= file: IQuillDelta|IQuillDelta[]|File|IAppointment|IEhrApiKey|IForm, >>>>>>> file: IQuillDelta|IQuillDelta[]|File|IAppointment|IEhrApiKey|IForm|IWallet, <<<<<<< this.fileIsForm(file) ? this.accountDatabaseService.uploadItem( url, Form, <Form> file, SecurityModels.privateSigned, key ) : this.accountDatabaseService.uploadItem( url, Wallet, <Wallet> file, undefined, key ) ======= this.fileIsEhrApiKey(file) ? this.accountDatabaseService.uploadItem( url, EhrApiKey, <EhrApiKey> file, undefined, key ) : this.accountDatabaseService.uploadItem( url, Form, <Form> file, SecurityModels.privateSigned, key ) >>>>>>> this.fileIsEhrApiKey(file) ? this.accountDatabaseService.uploadItem( url, EhrApiKey, <EhrApiKey> file, undefined, key ) : this.fileIsForm(file) ? this.accountDatabaseService.uploadItem( url, Form, <Form> file, SecurityModels.privateSigned, key ) : this.accountDatabaseService.uploadItem( url, Wallet, <Wallet> file, undefined, key ) <<<<<<< this.fileIsForm(file) ? 'cyph/form' : 'cyph/wallet' ======= this.fileIsEhrApiKey(file) ? 'cyph/ehr-api-key' : 'cyph/form' >>>>>>> this.fileIsEhrApiKey(file) ? 'cyph/ehr-api-key' : this.fileIsForm(file) ? 'cyph/form' : 'cyph/wallet' <<<<<<< this.fileIsForm(file) ? AccountFileRecord.RecordTypes.Form : AccountFileRecord.RecordTypes.Wallet ======= this.fileIsEhrApiKey(file) ? AccountFileRecord.RecordTypes.EhrApiKey : AccountFileRecord.RecordTypes.Form >>>>>>> this.fileIsEhrApiKey(file) ? AccountFileRecord.RecordTypes.EhrApiKey : this.fileIsForm(file) ? AccountFileRecord.RecordTypes.Form : AccountFileRecord.RecordTypes.Wallet
<<<<<<< this.routerService.navigate(['account', 'messages', username]); ======= this.router.navigate(['account', 'chat', username]); >>>>>>> this.router.navigate(['account', 'messages', username]);
<<<<<<< private setEventSubscription(name: Array<string>, status: string) { ======= public getExplicitHostParam(): string { return this.getHostParam() || ''; } private setEventSubscription(name: string, status: string) { >>>>>>> public getExplicitHostParam(): string { return this.getHostParam() || ''; } private setEventSubscription(name: Array<string>, status: string) {
<<<<<<< public importShares(volumeId) { return this.volumeDao.importShares(volumeId); } public updateVolumeTopology(volume: any, topology: any) { ======= public updateVolumeTopology(volume: Volume, topology: ZfsTopology) { >>>>>>> public importShares(volumeId) { return this.volumeDao.importShares(volumeId); } public updateVolumeTopology(volume: Volume, topology: ZfsTopology) {
<<<<<<< <input id="other_shell" type="text" class="form-control" :disabled="useDefaultShell===1" v-model="shell"> <div v-if="shellErrorMsg != ''" class="text-center"><i class="fas fa-exclamation-triangle"></i> {{ shellErrorMsg }}</div> ======= <input id="other_shell" class="form-control" :disabled="useDefaultShell===1" v-model.lazy="shell" list="etcShells"> <datalist id="etcShells"> <option v-for="item in etcShells" :value="item"></option> </datalist> >>>>>>> <input id="other_shell" type="text" class="form-control" :disabled="useDefaultShell===1" v-model="shell" list="etcShells"> <div v-if="shellErrorMsg != ''" class="text-center"><i class="fas fa-exclamation-triangle"></i> {{ shellErrorMsg }}</div> <datalist id="etcShells"> <option v-for="item in etcShells" :value="item"></option> </datalist> <<<<<<< shellErrorMsg = ""; ======= etcShells: string[] = []; >>>>>>> shellErrorMsg = ""; etcShells: string[] = [];
<<<<<<< try { return (await Gopass.execute(`history ${key}`)) .split(lineSplitRegex) .filter(isDefined) .map(historyLine => { const lineSplit = historyLine.split(' - ') return { hash: lineSplit[0], author: lineSplit[1], timestamp: lineSplit[2], message: lineSplit[3] } }) } catch (e) { return [] } ======= return (await Gopass.execute(`history "${escapeShellValue(key)}"`)) .split(lineSplitRegex) .filter(isDefined) .map(historyLine => { const lineSplit = historyLine.split(' - ') return { hash: lineSplit[0], author: lineSplit[1], timestamp: lineSplit[2], message: lineSplit[3] } }) >>>>>>> try { return (await Gopass.execute(`history "${escapeShellValue(key)}"`)) .split(lineSplitRegex) .filter(isDefined) .map(historyLine => { const lineSplit = historyLine.split(' - ') return { hash: lineSplit[0], author: lineSplit[1], timestamp: lineSplit[2], message: lineSplit[3] } }) } catch { return [] }
<<<<<<< function convertObjectToKey (this: Model<DocumentCarrier>, key: InputKey): KeyObject { let keyObject: KeyObject; const hashKey = this.getHashKey(); if (typeof key === "object") { const rangeKey = this.getRangeKey(); keyObject = { [hashKey]: key[hashKey] }; if (rangeKey && key[rangeKey]) { keyObject[rangeKey] = key[rangeKey]; } } else { keyObject = { [hashKey]: key }; } return keyObject; } // Transactions type GetTransactionResult = Promise<GetTransactionInput>; type CreateTransactionResult = Promise<CreateTransactionInput>; type DeleteTransactionResult = Promise<DeleteTransactionInput>; type UpdateTransactionResult = Promise<UpdateTransactionInput>; type ConditionTransactionResult = Promise<ConditionTransactionInput>; export interface GetTransaction { (key: InputKey): GetTransactionResult; (key: InputKey, settings?: ModelGetSettings): GetTransactionResult; (key: InputKey, settings: ModelGetSettings & {return: "document"}): GetTransactionResult; (key: InputKey, settings: ModelGetSettings & {return: "request"}): GetTransactionResult; } export interface CreateTransaction { (document: ObjectType): CreateTransactionResult; (document: ObjectType, settings: DocumentSaveSettings & {return: "request"}): CreateTransactionResult; (document: ObjectType, settings: DocumentSaveSettings & {return: "document"}): CreateTransactionResult; (document: ObjectType, settings?: DocumentSaveSettings): CreateTransactionResult; } export interface DeleteTransaction { (key: InputKey): DeleteTransactionResult; (key: InputKey, settings: ModelDeleteSettings & {return: "request"}): DeleteTransactionResult; (key: InputKey, settings: ModelDeleteSettings & {return: null}): DeleteTransactionResult; (key: InputKey, settings?: ModelDeleteSettings): DeleteTransactionResult; } export interface UpdateTransaction { (obj: ObjectType): CreateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType): UpdateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType, settings: ModelUpdateSettings & {"return": "document"}): UpdateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType, settings: ModelUpdateSettings & {"return": "request"}): UpdateTransactionResult; (keyObj: ObjectType, updateObj?: ObjectType, settings?: ModelUpdateSettings): UpdateTransactionResult; } export interface ConditionTransaction { (key: InputKey, condition: Condition): ConditionTransactionResult; } type TransactionType = { get: GetTransaction; create: CreateTransaction; delete: DeleteTransaction; update: UpdateTransaction; condition: ConditionTransaction; }; ======= >>>>>>> // Transactions type GetTransactionResult = Promise<GetTransactionInput>; type CreateTransactionResult = Promise<CreateTransactionInput>; type DeleteTransactionResult = Promise<DeleteTransactionInput>; type UpdateTransactionResult = Promise<UpdateTransactionInput>; type ConditionTransactionResult = Promise<ConditionTransactionInput>; export interface GetTransaction { (key: InputKey): GetTransactionResult; (key: InputKey, settings?: ModelGetSettings): GetTransactionResult; (key: InputKey, settings: ModelGetSettings & {return: "document"}): GetTransactionResult; (key: InputKey, settings: ModelGetSettings & {return: "request"}): GetTransactionResult; } export interface CreateTransaction { (document: ObjectType): CreateTransactionResult; (document: ObjectType, settings: DocumentSaveSettings & {return: "request"}): CreateTransactionResult; (document: ObjectType, settings: DocumentSaveSettings & {return: "document"}): CreateTransactionResult; (document: ObjectType, settings?: DocumentSaveSettings): CreateTransactionResult; } export interface DeleteTransaction { (key: InputKey): DeleteTransactionResult; (key: InputKey, settings: ModelDeleteSettings & {return: "request"}): DeleteTransactionResult; (key: InputKey, settings: ModelDeleteSettings & {return: null}): DeleteTransactionResult; (key: InputKey, settings?: ModelDeleteSettings): DeleteTransactionResult; } export interface UpdateTransaction { (obj: ObjectType): CreateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType): UpdateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType, settings: ModelUpdateSettings & {"return": "document"}): UpdateTransactionResult; (keyObj: ObjectType, updateObj: ObjectType, settings: ModelUpdateSettings & {"return": "request"}): UpdateTransactionResult; (keyObj: ObjectType, updateObj?: ObjectType, settings?: ModelUpdateSettings): UpdateTransactionResult; } export interface ConditionTransaction { (key: InputKey, condition: Condition): ConditionTransactionResult; } type TransactionType = { get: GetTransaction; create: CreateTransaction; delete: DeleteTransaction; update: UpdateTransaction; condition: ConditionTransaction; };
<<<<<<< import { DynamoDB, AWSError } from "aws-sdk"; import { ValueType } from "./Schema"; import { CallbackType, ObjectType } from "./General"; import { PopulateDocument, PopulateSettings } from "./Populate"; ======= import {DynamoDB, AWSError} from "aws-sdk"; import {ValueType} from "./Schema"; import {CallbackType, ObjectType} from "./General"; import {SerializerOptions} from "./Serializer"; >>>>>>> import {DynamoDB, AWSError} from "aws-sdk"; import {ValueType} from "./Schema"; import {CallbackType, ObjectType} from "./General"; import {SerializerOptions} from "./Serializer"; import {PopulateDocument, PopulateSettings} from "./Populate"; <<<<<<< // toJSON toJSON(): ObjectType { return utils.dynamoose.documentToJSON.bind(this)(); } ======= // toJSON toJSON (): ObjectType { return {...this}; } // Serializer serialize (nameOrOptions?: SerializerOptions | string): ObjectType { return this.model.serializer._serialize(this, nameOrOptions); } >>>>>>> // toJSON toJSON (): ObjectType { return utils.dynamoose.documentToJSON.bind(this)(); } // Serializer serialize (nameOrOptions?: SerializerOptions | string): ObjectType { return this.model.serializer._serialize(this, nameOrOptions); } <<<<<<< Document.prototype.conformToSchema = async function(this: Document, settings: DocumentObjectFromSchemaSettings = {"type": "fromDynamo"}): Promise<Document> { let document = this; if (settings.type === "fromDynamo") { document = await this.prepareForResponse(); } Document.prepareForObjectFromSchema(document, document.model, settings); const expectedObject = await Document.objectFromSchema(document, document.model, settings); ======= Document.prototype.conformToSchema = async function (this: Document, settings: DocumentObjectFromSchemaSettings = {"type": "fromDynamo"}): Promise<Document> { Document.prepareForObjectFromSchema(this, this.model, settings); const expectedObject = await Document.objectFromSchema(this, this.model, settings); >>>>>>> Document.prototype.conformToSchema = async function (this: Document, settings: DocumentObjectFromSchemaSettings = {"type": "fromDynamo"}): Promise<Document> { let document = this; if (settings.type === "fromDynamo") { document = await this.prepareForResponse(); } Document.prepareForObjectFromSchema(document, document.model, settings); const expectedObject = await Document.objectFromSchema(document, document.model, settings);
<<<<<<< import { DynamoDB } from "aws-sdk"; import { ModelType } from "./General"; ======= import {DynamoDB} from "aws-sdk"; >>>>>>> import {DynamoDB} from "aws-sdk"; import {ModelType} from "./General"; <<<<<<< "isOfType": this.jsType.func ? this.jsType.func : ((val): {value: ValueType; type: string} => { return [{"value": this.jsType, "type": "main"}, {"value": (this.dynamodbType instanceof DynamoDBType ? type.jsType : null), "type": "underlying"}].filter((a) => Boolean(a.value)).find((jsType) => typeof jsType.value === "string" ? typeof val === jsType.value : val instanceof jsType.value); }), "isSet": false, typeSettings ======= "isOfType": this.jsType.func ? this.jsType.func : (val): {value: ValueType; type: string} => { return [{"value": this.jsType, "type": "main"}, {"value": this.dynamodbType instanceof DynamoDBType ? type.jsType : null, "type": "underlying"}].filter((a) => Boolean(a.value)).find((jsType) => typeof jsType.value === "string" ? typeof val === jsType.value : val instanceof jsType.value); }, "isSet": false >>>>>>> "isOfType": this.jsType.func ? this.jsType.func : (val): {value: ValueType; type: string} => { return [{"value": this.jsType, "type": "main"}, {"value": this.dynamodbType instanceof DynamoDBType ? type.jsType : null, "type": "underlying"}].filter((a) => Boolean(a.value)).find((jsType) => typeof jsType.value === "string" ? typeof val === jsType.value : val instanceof jsType.value); }, "isSet": false, typeSettings <<<<<<< if (typeof object[key] === "object" && object[key] !== null && (object[key] as AttributeDefinition).schema) { checkAttributeNameDots(((object[key] as AttributeDefinition).schema as SchemaDefinition)/*, key*/); ======= if (typeof object[key] === "object" && (object[key] as AttributeDefinition).schema) { checkAttributeNameDots((object[key] as AttributeDefinition).schema as SchemaDefinition/*, key*/); >>>>>>> if (typeof object[key] === "object" && object[key] !== null && (object[key] as AttributeDefinition).schema) { checkAttributeNameDots((object[key] as AttributeDefinition).schema as SchemaDefinition/*, key*/);
<<<<<<< batchPut(items: DataSchema[], options?: PutOptions, callback?: (err: Error, items: Model[]) => void): Promise<Model[]>; batchPut(items: DataSchema[], callback?: (err: Error, items: Model[]) => void): Promise<Model[]>; create(item: DataSchema, options?: PutOptions, callback?: (err: Error, model: Model) => void): Promise<Model>; create(item: DataSchema, callback?: (err: Error, model: Model) => void): Promise<Model>; create(item: DataSchema, options?: PutOptions): Promise<Model>; ======= batchPut(items: DataSchema[], options?: PutOptions, callback?: (err: Error, items: ModelSchema<DataSchema>[]) => void): Promise<ModelSchema<DataSchema>[]>; batchPut(items: DataSchema[], callback?: (err: Error, items: ModelSchema<DataSchema>[]) => void): Promise<ModelSchema<DataSchema>[]>; create(item: DataSchema, callback?: (err: Error, model: ModelSchema<DataSchema>) => void): Promise<ModelSchema<DataSchema>>; >>>>>>> batchPut(items: DataSchema[], options?: PutOptions, callback?: (err: Error, items: ModelSchema<DataSchema>[]) => void): Promise<ModelSchema<DataSchema>[]>; batchPut(items: DataSchema[], callback?: (err: Error, items: ModelSchema<DataSchema>[]) => void): Promise<ModelSchema<DataSchema>[]>; create(item: DataSchema, options?: PutOptions, callback?: (err: Error, model: ModelSchema<DataSchema>) => void): Promise<ModelSchema<DataSchema>>; create(item: DataSchema, callback?: (err: Error, model: ModelSchema<DataSchema>) => void): Promise<ModelSchema<DataSchema>>; create(item: DataSchema, options?: PutOptions): Promise<ModelSchema<DataSchema>>;
<<<<<<< export function ddb(): typeof _AWS.DynamoDB; export function setDocumentClient(documentClient: _AWS.DynamoDB.DocumentClient): void; ======= export function ddb(): _AWS.DynamoDB; >>>>>>> export function ddb(): _AWS.DynamoDB; export function setDocumentClient(documentClient: _AWS.DynamoDB.DocumentClient): void;
<<<<<<< // Types import { AuthCallback } from "../types/AuthCallback"; ======= import { BrowserAuthError } from "../error/BrowserAuthError"; import { BrowserUtils } from "../utils/BrowserUtils"; /** * A type alias for an authResponseCallback function. * {@link (authResponseCallback:type)} * @param authErr error created for failure cases * @param response response containing token strings in success cases, or just state value in error cases */ export type AuthCallback = (authErr: AuthError, response?: AuthResponse) => void; /** * Key-Value type to support queryParams, extraQueryParams and claims */ export type StringDict = {[key: string]: string}; >>>>>>> // Types import { AuthCallback } from "../types/AuthCallback"; import { BrowserUtils } from "../utils/BrowserUtils"; <<<<<<< loginRedirect(request: AuthenticationParameters): void { // Check if callback has been set. If not, handleRedirectCallbacks wasn't called correctly. ======= loginRedirect(request?: AuthenticationParameters): void { >>>>>>> loginRedirect(request?: AuthenticationParameters): void { // Check if callback has been set. If not, handleRedirectCallbacks wasn't called correctly. <<<<<<< acquireTokenRedirect(request: AuthenticationParameters): void { // Check if callback has been set. If not, handleRedirectCallbacks wasn't called correctly. ======= acquireTokenRedirect(request?: AuthenticationParameters): void { >>>>>>> acquireTokenRedirect(request?: AuthenticationParameters): void { // Check if callback has been set. If not, handleRedirectCallbacks wasn't called correctly. <<<<<<< // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds. const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.popupWindowTimeout, navigateUrl); // Handle response from hash string. ======= const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.windowHashTimeout, navigateUrl); >>>>>>> // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds. const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.windowHashTimeout, navigateUrl); // Handle response from hash string. <<<<<<< // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds. const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.popupWindowTimeout, navigateUrl); // Handle response from hash string. ======= const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.windowHashTimeout, navigateUrl); >>>>>>> // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds. const hash = await interactionHandler.monitorWindowForHash(popupWindow, this.config.system.windowHashTimeout, navigateUrl); // Handle response from hash string.
<<<<<<< import { RouterlessTracking } from './routing/routerless'; ======= import { advance, createRoot, createRootWithRouter, RootCmp, RoutesConfig, TestModule, } from '../test.mocks'; >>>>>>> import { advance, createRoot, createRootWithRouter, RootCmp, RoutesConfig, TestModule, } from '../test.mocks'; import { RouterlessTracking } from './routing/routerless';
<<<<<<< expect(EventSpy).toHaveBeenCalledWith({ path: '/sections/123/pages/456' }); ======= expect(EventSpy).toHaveBeenCalledWith({ path: '/sections/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages/456', location: location }); >>>>>>> expect(EventSpy).toHaveBeenCalledWith({ path: '/sections/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages/456', }); <<<<<<< fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x) => EventSpy(x)); angulartics2.settings.pageTracking.clearIds = true; (<SpyLocation>location).simulateUrlPop('/sections/123/pages/456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/sections/pages' }); }))); ======= fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearIds = true; (<SpyLocation>location).simulateUrlPop('/0sections0/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages?param=456', location: location }); }))); it('should remove ids using custom regex if idsRegExp is set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearIds = true; angulartics2.settings.pageTracking.idsRegExp = /^[a-z]\d+$/; (<SpyLocation>location).simulateUrlPop('/0sections0/a01/pages/page/2/summary?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages/page/2/summary?param=456', location: location }); }))); it('should remove query params if clearQueryParams is set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearQueryParams = true; (<SpyLocation>location).simulateUrlPop('/0sections0/a01/pages/page/2/summary?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/a01/pages/page/2/summary', location: location }); }))); it('should remove ids and query params if clearQueryParams and clearIds are set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearQueryParams = true; angulartics2.settings.pageTracking.clearIds = true; (<SpyLocation>location).simulateUrlPop('/0sections0/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages', location: location }); }))); >>>>>>> fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearIds = true; (<SpyLocation>location).simulateUrlPop('/0sections0/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages?param=456' }); }))); it('should remove ids using custom regex if idsRegExp is set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearIds = true; angulartics2.settings.pageTracking.idsRegExp = /^[a-z]\d+$/; (<SpyLocation>location).simulateUrlPop('/0sections0/a01/pages/page/2/summary?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages/page/2/summary?param=456', location: location }); }))); it('should remove query params if clearQueryParams is set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearQueryParams = true; (<SpyLocation>location).simulateUrlPop('/0sections0/a01/pages/page/2/summary?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/a01/pages/page/2/summary', location: location }); }))); it('should remove ids and query params if clearQueryParams and clearIds are set', fakeAsync(inject([Router, Location, Angulartics2], (router: Router, location: Location, angulartics2: Angulartics2) => { fixture = createRootWithRouter(router, RootCmp); angulartics2.pageTrack.subscribe((x: any) => EventSpy(x)); angulartics2.settings.pageTracking.clearQueryParams = true; angulartics2.settings.pageTracking.clearIds = true; (<SpyLocation>location).simulateUrlPop('/0sections0/01234567-9ABC-DEF0-1234-56789ABCDEF0/pages?param=456'); advance(fixture); expect(EventSpy).toHaveBeenCalledWith({ path: '/0sections0/pages', location: location }); })));
<<<<<<< const CommandActionExecutor = require('@oracle/suitecloud-cli/src/core/CommandActionExecutor'); const CommandOptionsValidator = require('@oracle/suitecloud-cli/src/core/CommandOptionsValidator'); const CLIConfigurationService = require('@oracle/suitecloud-cli/src/core/extensibility/CLIConfigurationService'); const AuthenticationService = require('@oracle/suitecloud-cli/src/services/AuthenticationService'); ======= import { CommandActionExecutor, CommandOptionsValidator, CLIConfigurationService, CommandInstanceFactory } from '../util/ExtensionUtil'; import CommandsMetadataSingleton from '../service/CommandsMetadataSingleton'; >>>>>>> import { CommandActionExecutor, CommandOptionsValidator, CLIConfigurationService } from '../util/ExtensionUtil'; import CommandsMetadataSingleton from '../service/CommandsMetadataSingleton'; <<<<<<< commandsMetadataService: CommandsMetadataSingleton.getInstance(), log: new VSConsoleLogger(), ======= commandInstanceFactory: new CommandInstanceFactory(), commandsMetadataService: CommandsMetadataSingleton.getInstance(), consoleLogger: new VSConsoleLogger(), >>>>>>> commandsMetadataService: CommandsMetadataSingleton.getInstance(), log: new VSConsoleLogger(),
<<<<<<< audio: WebAudio; ======= audioOnly: boolean; >>>>>>> audio: WebAudio; audioOnly: boolean; <<<<<<< mutePage: boolean; ======= iframe: boolean; lastSubtitle: string; muted: boolean; mutePage: boolean; subtitleSelector: string; >>>>>>> iframe: boolean; mutePage: boolean; <<<<<<< youTubeMutePage: boolean; ======= unmuteDelay: number; volume: number; >>>>>>> youTubeMutePage: boolean; <<<<<<< this.mutePage = false; ======= this.muted = false; >>>>>>> this.mutePage = false; <<<<<<< ======= this.unmuteDelay = 0; this.volume = 1; >>>>>>> <<<<<<< } else if (filter.mutePage && filter.audio.supportedNode(node)) { filter.audio.clean(filter, node); } else { ======= } else if (filter.mutePage && WebAudio.supportedNode(filter.hostname, node)) { WebAudio.clean(filter, node, filter.subtitleSelector); } else if (!filter.audioOnly) { >>>>>>> } else if (filter.mutePage && filter.audio.supportedNode(node)) { filter.audio.clean(filter, node); } else if (!filter.audioOnly) {
<<<<<<< return function *orchestrator(): Operation { let orchestrator = yield ({ resume, context: { parent }}) => resume(parent); ======= return function *orchestrator(): Sequence { let orchestrator = this; // eslint-disable-line @typescript-eslint/no-this-alias let state = new State(); >>>>>>> return function *orchestrator(): Operation { let orchestrator = yield ({ resume, context: { parent }}) => resume(parent); let state = new State(); <<<<<<< yield fork(createConnectionServer(orchestrator, { ======= fork(createConnectionServer(orchestrator, { state: state, >>>>>>> yield fork(createConnectionServer(orchestrator, { state: state,
<<<<<<< * @param {string} options.fallbackLocale One locale from options.locales to use if a key is not found in the current locale ======= * @param {boolean} options.escapeHtml To escape html. Default value is true. >>>>>>> * @param {string} options.fallbackLocale One locale from options.locales to use if a key is not found in the current locale * @param {boolean} options.escapeHtml To escape html. Default value is true.
<<<<<<< import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component'; import { DateFilter } from './filters/dateFilter.pipe'; import { NameFilter } from './filters/nameFilter.pipe'; ======= import { CustomAdaptersComponent } from './components/preferences/common/custom-adapters/custom-adapters.component'; >>>>>>> import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component'; import { DateFilter } from './filters/dateFilter.pipe'; import { NameFilter } from './filters/nameFilter.pipe'; import { CustomAdaptersComponent } from './components/preferences/common/custom-adapters/custom-adapters.component'; <<<<<<< SearchFilter, DateFilter, NameFilter, ListOfSnapshotsComponent ======= SearchFilter, CustomAdaptersComponent >>>>>>> SearchFilter, DateFilter, NameFilter, ListOfSnapshotsComponent, CustomAdaptersComponent
<<<<<<< public onTextAdded(evt: TextAddedDataEvent) { this.resetDrawToolChoice(); let drawing = this.getDrawingMock("text", evt.savedText); (drawing.element as TextElement).text = evt.savedText; let svgText = this.mapDrawingToSvgConverter.convert(drawing); this.drawingService .add(this.server, this.project.project_id, evt.x - this.mapChild.context.getZeroZeroTransformationPoint().x, evt.y - this.mapChild.context.getZeroZeroTransformationPoint().y, svgText) .subscribe((serverDrawing: Drawing) => { document.body.style.cursor = "default"; this.drawingsDataSource.add(serverDrawing); this.drawingsEventSource.textSaved.emit(true); }); } public onTextEdited(evt: TextEditedDataEvent) { ======= public onDrawingSaved(evt: boolean){ this.resetDrawToolChoice(); } public onTextEdited(evt: TextEditedDataEvent){ >>>>>>> public onDrawingSaved(evt: boolean){ this.resetDrawToolChoice(); } public onTextEdited(evt: TextEditedDataEvent){ <<<<<<< public hideMenu() { var map = document.getElementsByClassName('map')[0]; map.removeEventListener('click', this.drawListener as EventListenerOrEventListenerObject); ======= public hideMenu(){ >>>>>>> public hideMenu(){ <<<<<<< public getDrawingMock(objectType: string, text?: string): MapDrawing { let drawingElement: DrawingElement; switch (objectType) { case "rectangle": let rectElement = new RectElement(); rectElement.fill = "#ffffff"; rectElement.fill_opacity = 1.0; rectElement.stroke = "#000000"; rectElement.stroke_width = 2; rectElement.width = 200; rectElement.height = 100; drawingElement = rectElement; break; case "ellipse": let ellipseElement = new EllipseElement(); ellipseElement.fill = "#ffffff"; ellipseElement.fill_opacity = 1.0; ellipseElement.stroke = "#000000"; ellipseElement.stroke_width = 2; ellipseElement.cx = 100; ellipseElement.cy = 100; ellipseElement.rx = 100; ellipseElement.ry = 100; ellipseElement.width = 200; ellipseElement.height = 200; drawingElement = ellipseElement; break; case "line": let lineElement = new LineElement(); lineElement.stroke = "#000000"; lineElement.stroke_width = 2; lineElement.x1 = 0; lineElement.x2 = 200; lineElement.y1 = 0; lineElement.y2 = 0; lineElement.width = 100; lineElement.height = 0; drawingElement = lineElement; break; case "text": let textElement = new TextElement(); textElement.height = 100; textElement.width = 100; textElement.text = text; textElement.fill = "#000000"; textElement.fill_opacity = 0; textElement.font_family = "Noto Sans"; textElement.font_size = 11; textElement.font_weight = "bold"; drawingElement = textElement; break; } let mapDrawing = new MapDrawing(); mapDrawing.element = drawingElement; return mapDrawing; } public addText() { if (!this.drawTools.isAddingTextChosen){ this.resetDrawToolChoice(); this.drawTools.isAddingTextChosen = true; var map = document.getElementsByClassName('map')[0]; map.removeEventListener('click', this.drawListener as EventListenerOrEventListenerObject); } else { this.resetDrawToolChoice(); } } ======= >>>>>>>
<<<<<<< import { PopTokenGenerator } from "../crypto/PopTokenGenerator"; ======= import { RequestThumbprint } from "../network/RequestThumbprint"; >>>>>>> import { PopTokenGenerator } from "../crypto/PopTokenGenerator"; import { RequestThumbprint } from "../network/RequestThumbprint"; <<<<<<< const requestBody = await this.createTokenRequestBody(request); ======= const thumbprint: RequestThumbprint = { clientId: this.config.authOptions.clientId, authority: authority.canonicalAuthority, scopes: request.scopes }; const requestBody = this.createTokenRequestBody(request); >>>>>>> const thumbprint: RequestThumbprint = { clientId: this.config.authOptions.clientId, authority: authority.canonicalAuthority, scopes: request.scopes }; const requestBody = await this.createTokenRequestBody(request);
<<<<<<< maxHeight: '600px', autoFocus: false ======= autoFocus: false, disableClose: true >>>>>>> maxHeight: '600px', autoFocus: false, disableClose: true
<<<<<<< getConfiguration(server: Server, node: Node) { return of('sample config'); } saveConfiguration(server: Server, node: Node, configuration: string) { return of(configuration); } ======= update(server: Server, node: Node) { return of(node); } >>>>>>> getConfiguration(server: Server, node: Node) { return of('sample config'); } saveConfiguration(server: Server, node: Node, configuration: string) { return of(configuration); } update(server: Server, node: Node) { return of(node); }
<<<<<<< import { ConsoleDeviceActionComponent } from './components/project-map/context-menu/actions/console-device-action/console-device-action.component'; import { ConsoleComponent } from './components/settings/console/console.component'; ======= import { NodesMenuComponent } from './components/project-map/nodes-menu/nodes-menu.component'; import { PacketFiltersActionComponent } from './components/project-map/context-menu/actions/packet-filters-action/packet-filters-action.component'; import { PacketFiltersDialogComponent } from './components/project-map/packet-capturing/packet-filters/packet-filters.component'; import { HelpDialogComponent } from './components/project-map/help-dialog/help-dialog.component'; import { StartCaptureActionComponent } from './components/project-map/context-menu/actions/start-capture/start-capture-action.component'; import { StartCaptureDialogComponent } from './components/project-map/packet-capturing/start-capture/start-capture.component'; import { SuspendLinkActionComponent } from './components/project-map/context-menu/actions/suspend-link/suspend-link-action.component'; import { ResumeLinkActionComponent } from './components/project-map/context-menu/actions/resume-link-action/resume-link-action.component'; import { StopCaptureActionComponent } from './components/project-map/context-menu/actions/stop-capture/stop-capture-action.component'; >>>>>>> import { ConsoleDeviceActionComponent } from './components/project-map/context-menu/actions/console-device-action/console-device-action.component'; import { ConsoleComponent } from './components/settings/console/console.component'; import { NodesMenuComponent } from './components/project-map/nodes-menu/nodes-menu.component'; import { PacketFiltersActionComponent } from './components/project-map/context-menu/actions/packet-filters-action/packet-filters-action.component'; import { PacketFiltersDialogComponent } from './components/project-map/packet-capturing/packet-filters/packet-filters.component'; import { HelpDialogComponent } from './components/project-map/help-dialog/help-dialog.component'; import { StartCaptureActionComponent } from './components/project-map/context-menu/actions/start-capture/start-capture-action.component'; import { StartCaptureDialogComponent } from './components/project-map/packet-capturing/start-capture/start-capture.component'; import { SuspendLinkActionComponent } from './components/project-map/context-menu/actions/suspend-link/suspend-link-action.component'; import { ResumeLinkActionComponent } from './components/project-map/context-menu/actions/resume-link-action/resume-link-action.component'; import { StopCaptureActionComponent } from './components/project-map/context-menu/actions/stop-capture/stop-capture-action.component'; <<<<<<< CustomAdaptersComponent, ConsoleDeviceActionComponent, ConsoleComponent ======= CustomAdaptersComponent, NodesMenuComponent >>>>>>> CustomAdaptersComponent, ConsoleDeviceActionComponent, ConsoleComponent, NodesMenuComponent
<<<<<<< import { MapScaleService } from '../../services/mapScale.service'; ======= import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer'; >>>>>>> import { MapScaleService } from '../../services/mapScale.service'; import { NodeCreatedLabelStylesFixer } from './helpers/node-created-label-styles-fixer'; <<<<<<< { provide: MapScaleService } ======= { provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer} >>>>>>> { provide: MapScaleService }, { provide: NodeCreatedLabelStylesFixer, useValue: nodeCreatedLabelStylesFixer}
<<<<<<< import { DuplicateActionComponent } from './components/project-map/context-menu/actions/duplicate-action/duplicate-action.component'; ======= import { HelpComponent } from './components/help/help.component'; >>>>>>> import { DuplicateActionComponent } from './components/project-map/context-menu/actions/duplicate-action/duplicate-action.component'; import { HelpComponent } from './components/help/help.component';
<<<<<<< import { ShowNodeActionComponent } from './components/project-map/context-menu/actions/show-node-action/show-node-action.component'; import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component'; import { InfoService } from './services/info.service'; ======= import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component'; >>>>>>> import { ShowNodeActionComponent } from './components/project-map/context-menu/actions/show-node-action/show-node-action.component'; import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component'; import { InfoService } from './services/info.service'; import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component'; <<<<<<< HelpComponent, InfoDialogComponent ======= HelpComponent, BringToFrontActionComponent >>>>>>> HelpComponent, InfoDialogComponent, BringToFrontActionComponent
<<<<<<< import { Label } from '../../../../cartography/models/label'; import { NodeService } from '../../../../services/node.service'; import { Node } from '../../../../cartography/models/node'; import { NodesDataSource } from '../../../../cartography/datasources/nodes-datasource'; import { Link } from '../../../../models/link'; import { LinkNode } from '../../../../models/link-node'; import { LinkService } from '../../../../services/link.service'; import { LinksDataSource } from '../../../../cartography/datasources/links-datasource'; ======= import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; import { ToasterService } from '../../../../services/toaster.service'; import { RotationValidator } from '../../../../validators/rotation-validator'; >>>>>>> import { Label } from '../../../../cartography/models/label'; import { NodeService } from '../../../../services/node.service'; import { Node } from '../../../../cartography/models/node'; import { NodesDataSource } from '../../../../cartography/datasources/nodes-datasource'; import { Link } from '../../../../models/link'; import { LinkNode } from '../../../../models/link-node'; import { LinkService } from '../../../../services/link.service'; import { LinksDataSource } from '../../../../cartography/datasources/links-datasource'; import { FormBuilder, FormGroup, FormControl, Validators } from '@angular/forms'; import { ToasterService } from '../../../../services/toaster.service'; import { RotationValidator } from '../../../../validators/rotation-validator'; <<<<<<< rotation: string; isTextEditable: boolean; ======= formGroup: FormGroup; >>>>>>> rotation: string; isTextEditable: boolean; formGroup: FormGroup; <<<<<<< private renderer: Renderer2, private nodeService: NodeService, private nodesDataSource: NodesDataSource, private linkService: LinkService, private linksDataSource: LinksDataSource ) {} ======= private renderer: Renderer2, private formBuilder: FormBuilder, private toasterService: ToasterService, private rotationValidator: RotationValidator ) { this.formGroup = this.formBuilder.group({ rotation: new FormControl('', [Validators.required, rotationValidator.get]) }); } >>>>>>> private renderer: Renderer2, private nodeService: NodeService, private nodesDataSource: NodesDataSource, private linkService: LinkService, private linksDataSource: LinksDataSource, private formBuilder: FormBuilder, private toasterService: ToasterService, private rotationValidator: RotationValidator ) {} <<<<<<< if (this.drawing) { this.isTextEditable = true; this.rotation = this.drawing.rotation.toString(); this.element = this.drawing.element as TextElement; } else if (this.label && this.node) { this.isTextEditable = false; this.rotation = this.label.rotation.toString(); this.element = this.getTextElementFromLabel(); } else if (this.linkNode && this.link) { this.isTextEditable = true; this.label = this.link.nodes.find(n => n.node_id === this.linkNode.node_id).label; this.rotation = this.label.rotation.toString(); this.element = this.getTextElementFromLabel(); } ======= this.formGroup.controls['rotation'].setValue(this.drawing.rotation); this.element = this.drawing.element as TextElement; >>>>>>> this.formGroup = this.formBuilder.group({ rotation: new FormControl('', [Validators.required, this.rotationValidator.get]) }); if (this.drawing) { this.isTextEditable = true; this.rotation = this.drawing.rotation.toString(); this.element = this.drawing.element as TextElement; } else if (this.label && this.node) { this.isTextEditable = false; this.rotation = this.label.rotation.toString(); this.element = this.getTextElementFromLabel(); } else if (this.linkNode && this.link) { this.isTextEditable = true; this.label = this.link.nodes.find(n => n.node_id === this.linkNode.node_id).label; this.rotation = this.label.rotation.toString(); this.element = this.getTextElementFromLabel(); } this.formGroup.controls['rotation'].setValue(this.rotation); <<<<<<< if (this.drawing) { this.drawing.rotation = +this.rotation; this.drawing.element = this.element; let mapDrawing = this.drawingToMapDrawingConverter.convert(this.drawing); mapDrawing.element = this.drawing.element; this.drawing.svg = this.mapDrawingToSvgConverter.convert(mapDrawing); this.drawingService.update(this.server, this.drawing).subscribe((serverDrawing: Drawing) => { this.drawingsDataSource.update(serverDrawing); this.dialogRef.close(); }); } else if (this.label && this.node) { this.node.label.style = this.getStyleFromTextElement(); this.node.label.rotation = +this.rotation; this.nodeService.updateLabel(this.server, this.node, this.node.label).subscribe((node: Node) => { this.nodesDataSource.update(node); this.dialogRef.close(); }); } else if (this.linkNode && this.link) { this.label.style = this.getStyleFromTextElement(); this.label.rotation = +this.rotation; this.label.text = this.element.text; this.linkService.updateLink(this.server, this.link).subscribe((link: Link) => { this.linksDataSource.update(link); this.dialogRef.close(); }); } ======= if (this.formGroup.valid) { this.drawing.rotation = this.formGroup.get('rotation').value; this.drawing.element = this.element; let mapDrawing = this.drawingToMapDrawingConverter.convert(this.drawing); mapDrawing.element = this.drawing.element; this.drawing.svg = this.mapDrawingToSvgConverter.convert(mapDrawing); this.drawingService.update(this.server, this.drawing).subscribe((serverDrawing: Drawing) => { this.drawingsDataSource.update(serverDrawing); this.dialogRef.close(); }); } else { this.toasterService.error(`Entered data is incorrect`); } >>>>>>> if (this.formGroup.valid) { this.rotation = this.formGroup.get('rotation').value; if (this.drawing) { this.drawing.rotation = +this.rotation; this.drawing.element = this.element; let mapDrawing = this.drawingToMapDrawingConverter.convert(this.drawing); mapDrawing.element = this.drawing.element; this.drawing.svg = this.mapDrawingToSvgConverter.convert(mapDrawing); this.drawingService.update(this.server, this.drawing).subscribe((serverDrawing: Drawing) => { this.drawingsDataSource.update(serverDrawing); this.dialogRef.close(); }); } else if (this.label && this.node) { this.node.label.style = this.getStyleFromTextElement(); this.node.label.rotation = +this.rotation; this.nodeService.updateLabel(this.server, this.node, this.node.label).subscribe((node: Node) => { this.nodesDataSource.update(node); this.dialogRef.close(); }); } else if (this.linkNode && this.link) { this.label.style = this.getStyleFromTextElement(); this.label.rotation = +this.rotation; this.label.text = this.element.text; this.linkService.updateLink(this.server, this.link).subscribe((link: Link) => { this.linksDataSource.update(link); this.dialogRef.close(); }); } } else { this.toasterService.error(`Entered data is incorrect`); }
<<<<<<< import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; ======= import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component'; >>>>>>> import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; import { BringToFrontActionComponent } from './components/project-map/context-menu/actions/bring-to-front-action/bring-to-front-action.component'; <<<<<<< HelpComponent, SaveProjectDialogComponent ======= HelpComponent, BringToFrontActionComponent >>>>>>> HelpComponent, SaveProjectDialogComponent, BringToFrontActionComponent
<<<<<<< import { ServersComponent } from './components/servers/servers.component'; import { ProjectsComponent } from './components/projects/projects.component'; import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component'; import { SettingsComponent } from './components/settings/settings.component'; import { LocalServerComponent } from './components/local-server/local-server.component'; import { PreferencesComponent } from './components/preferences/preferences.component'; import { QemuPreferencesComponent } from './components/preferences/qemu/qemu-preferences/qemu-preferences.component'; import { QemuVmTemplatesComponent } from './components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component'; import { QemuVmTemplateDetailsComponent } from './components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component'; import { AddQemuVmTemplateComponent } from './components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component'; import { GeneralPreferencesComponent } from './components/preferences/general/general-preferences.component'; import { VpcsPreferencesComponent } from './components/preferences/vpcs/vpcs-preferences/vpcs-preferences.component'; import { VpcsTemplatesComponent } from './components/preferences/vpcs/vpcs-templates/vpcs-templates.component'; import { AddVpcsTemplateComponent } from './components/preferences/vpcs/add-vpcs-template/add-vpcs-template.component'; import { VpcsTemplateDetailsComponent } from './components/preferences/vpcs/vpcs-template-details/vpcs-template-details.component'; import { VirtualBoxPreferencesComponent } from './components/preferences/virtual-box/virtual-box-preferences/virtual-box-preferences.component'; import { VirtualBoxTemplatesComponent } from './components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component'; import { VirtualBoxTemplateDetailsComponent } from './components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component'; import { AddVirtualBoxTemplateComponent } from './components/preferences/virtual-box/add-virtual-box-template/add-virtual-box-template.component'; import { BuiltInPreferencesComponent } from './components/preferences/built-in/built-in-preferences.component'; import { EthernetHubsTemplatesComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component'; import { EthernetHubsAddTemplateComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-add-template/ethernet-hubs-add-template.component'; import { EthernetHubsTemplateDetailsComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-template-details/ethernet-hubs-template-details.component'; import { CloudNodesTemplatesComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component'; import { CloudNodesAddTemplateComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-add-template/cloud-nodes-add-template.component'; import { CloudNodesTemplateDetailsComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-template-details/cloud-nodes-template-details.component'; import { EthernetSwitchesTemplatesComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component'; import { EthernetSwitchesAddTemplateComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-add-template/ethernet-switches-add-template.component'; import { EthernetSwitchesTemplateDetailsComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component'; import { DynamipsPreferencesComponent } from './components/preferences/dynamips/dynamips-preferences/dynamips-preferences.component'; import { IosTemplatesComponent } from './components/preferences/dynamips/ios-templates/ios-templates.component'; ======= import { ServersComponent } from "./components/servers/servers.component"; import { ProjectsComponent } from "./components/projects/projects.component"; import { DefaultLayoutComponent } from "./layouts/default-layout/default-layout.component"; import { SettingsComponent } from "./components/settings/settings.component"; import { LocalServerComponent } from "./components/local-server/local-server.component"; import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component'; >>>>>>> import { ServersComponent } from './components/servers/servers.component'; import { ProjectsComponent } from './components/projects/projects.component'; import { DefaultLayoutComponent } from './layouts/default-layout/default-layout.component'; import { SettingsComponent } from './components/settings/settings.component'; import { LocalServerComponent } from './components/local-server/local-server.component'; import { PreferencesComponent } from './components/preferences/preferences.component'; import { QemuPreferencesComponent } from './components/preferences/qemu/qemu-preferences/qemu-preferences.component'; import { QemuVmTemplatesComponent } from './components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component'; import { QemuVmTemplateDetailsComponent } from './components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component'; import { AddQemuVmTemplateComponent } from './components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component'; import { GeneralPreferencesComponent } from './components/preferences/general/general-preferences.component'; import { VpcsPreferencesComponent } from './components/preferences/vpcs/vpcs-preferences/vpcs-preferences.component'; import { VpcsTemplatesComponent } from './components/preferences/vpcs/vpcs-templates/vpcs-templates.component'; import { AddVpcsTemplateComponent } from './components/preferences/vpcs/add-vpcs-template/add-vpcs-template.component'; import { VpcsTemplateDetailsComponent } from './components/preferences/vpcs/vpcs-template-details/vpcs-template-details.component'; import { VirtualBoxPreferencesComponent } from './components/preferences/virtual-box/virtual-box-preferences/virtual-box-preferences.component'; import { VirtualBoxTemplatesComponent } from './components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component'; import { VirtualBoxTemplateDetailsComponent } from './components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component'; import { AddVirtualBoxTemplateComponent } from './components/preferences/virtual-box/add-virtual-box-template/add-virtual-box-template.component'; import { BuiltInPreferencesComponent } from './components/preferences/built-in/built-in-preferences.component'; import { EthernetHubsTemplatesComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component'; import { EthernetHubsAddTemplateComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-add-template/ethernet-hubs-add-template.component'; import { EthernetHubsTemplateDetailsComponent } from './components/preferences/built-in/ethernet-hubs/ethernet-hubs-template-details/ethernet-hubs-template-details.component'; import { CloudNodesTemplatesComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component'; import { CloudNodesAddTemplateComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-add-template/cloud-nodes-add-template.component'; import { CloudNodesTemplateDetailsComponent } from './components/preferences/built-in/cloud-nodes/cloud-nodes-template-details/cloud-nodes-template-details.component'; import { EthernetSwitchesTemplatesComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component'; import { EthernetSwitchesAddTemplateComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-add-template/ethernet-switches-add-template.component'; import { EthernetSwitchesTemplateDetailsComponent } from './components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component'; import { DynamipsPreferencesComponent } from './components/preferences/dynamips/dynamips-preferences/dynamips-preferences.component'; import { IosTemplatesComponent } from './components/preferences/dynamips/ios-templates/ios-templates.component'; import { InstalledSoftwareComponent } from './components/installed-software/installed-software.component'; <<<<<<< { path: 'settings', component: SettingsComponent }, { path: 'server/:server_id/preferences', component: PreferencesComponent }, // { path: 'server/:server_id/preferences/general', component: GeneralPreferencesComponent }, { path: 'server/:server_id/preferences/builtin', component: BuiltInPreferencesComponent}, { path: 'server/:server_id/preferences/builtin/ethernet-hubs', component: EthernetHubsTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-hubs/addtemplate', component: EthernetHubsAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-hubs/:template_id', component: EthernetHubsTemplateDetailsComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches', component: EthernetSwitchesTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches/addtemplate', component: EthernetSwitchesAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches/:template_id', component: EthernetSwitchesTemplateDetailsComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes', component: CloudNodesTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes/addtemplate', component: CloudNodesAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes/:template_id', component: CloudNodesTemplateDetailsComponent }, //{ path: 'server/:server_id/preferences/dynamips', component: DynamipsPreferencesComponent }, { path: 'server/:server_id/preferences/dynamips/templates', component: IosTemplatesComponent }, { path: 'server/:server_id/preferences/dynamips/templates/addtemplate', component: IosTemplatesComponent }, { path: 'server/:server_id/preferences/dynamips/templates/:template_id', component: IosTemplatesComponent }, // { path: 'server/:server_id/preferences/qemu', component: QemuPreferencesComponent }, { path: 'server/:server_id/preferences/qemu/templates', component: QemuVmTemplatesComponent }, { path: 'server/:server_id/preferences/qemu/templates/:template_id', component: QemuVmTemplateDetailsComponent }, { path: 'server/:server_id/preferences/qemu/addtemplate', component: AddQemuVmTemplateComponent }, // { path: 'server/:server_id/preferences/vpcs', component: VpcsPreferencesComponent }, { path: 'server/:server_id/preferences/vpcs/templates', component: VpcsTemplatesComponent }, { path: 'server/:server_id/preferences/vpcs/templates/:template_id', component: VpcsTemplateDetailsComponent}, { path: 'server/:server_id/preferences/vpcs/addtemplate', component: AddVpcsTemplateComponent }, // { path: 'server/:server_id/preferences/virtualbox', component: VirtualBoxPreferencesComponent } { path: 'server/:server_id/preferences/virtualbox/templates', component: VirtualBoxTemplatesComponent }, { path: 'server/:server_id/preferences/virtualbox/templates/:template_id', component: VirtualBoxTemplateDetailsComponent }, { path: 'server/:server_id/preferences/virtualbox/addtemplate', component: AddVirtualBoxTemplateComponent } ======= { path: 'settings', component: SettingsComponent }, { path: 'installed-software', component: InstalledSoftwareComponent }, >>>>>>> { path: 'settings', component: SettingsComponent }, { path: 'installed-software', component: InstalledSoftwareComponent }, { path: 'server/:server_id/preferences', component: PreferencesComponent }, // { path: 'server/:server_id/preferences/general', component: GeneralPreferencesComponent }, { path: 'server/:server_id/preferences/builtin', component: BuiltInPreferencesComponent}, { path: 'server/:server_id/preferences/builtin/ethernet-hubs', component: EthernetHubsTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-hubs/addtemplate', component: EthernetHubsAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-hubs/:template_id', component: EthernetHubsTemplateDetailsComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches', component: EthernetSwitchesTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches/addtemplate', component: EthernetSwitchesAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/ethernet-switches/:template_id', component: EthernetSwitchesTemplateDetailsComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes', component: CloudNodesTemplatesComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes/addtemplate', component: CloudNodesAddTemplateComponent }, { path: 'server/:server_id/preferences/builtin/cloud-nodes/:template_id', component: CloudNodesTemplateDetailsComponent }, //{ path: 'server/:server_id/preferences/dynamips', component: DynamipsPreferencesComponent }, { path: 'server/:server_id/preferences/dynamips/templates', component: IosTemplatesComponent }, { path: 'server/:server_id/preferences/dynamips/templates/addtemplate', component: IosTemplatesComponent }, { path: 'server/:server_id/preferences/dynamips/templates/:template_id', component: IosTemplatesComponent }, // { path: 'server/:server_id/preferences/qemu', component: QemuPreferencesComponent }, { path: 'server/:server_id/preferences/qemu/templates', component: QemuVmTemplatesComponent }, { path: 'server/:server_id/preferences/qemu/templates/:template_id', component: QemuVmTemplateDetailsComponent }, { path: 'server/:server_id/preferences/qemu/addtemplate', component: AddQemuVmTemplateComponent }, // { path: 'server/:server_id/preferences/vpcs', component: VpcsPreferencesComponent }, { path: 'server/:server_id/preferences/vpcs/templates', component: VpcsTemplatesComponent }, { path: 'server/:server_id/preferences/vpcs/templates/:template_id', component: VpcsTemplateDetailsComponent}, { path: 'server/:server_id/preferences/vpcs/addtemplate', component: AddVpcsTemplateComponent }, // { path: 'server/:server_id/preferences/virtualbox', component: VirtualBoxPreferencesComponent } { path: 'server/:server_id/preferences/virtualbox/templates', component: VirtualBoxTemplatesComponent }, { path: 'server/:server_id/preferences/virtualbox/templates/:template_id', component: VirtualBoxTemplateDetailsComponent }, { path: 'server/:server_id/preferences/virtualbox/addtemplate', component: AddVirtualBoxTemplateComponent }
<<<<<<< import { MatButtonModule, MatCardModule, MatMenuModule, MatToolbarModule, MatStepperModule, MatIconModule, MatFormFieldModule, MatInputModule, MatTableModule, MatDialogModule, MatProgressBarModule, MatProgressSpinnerModule, MatSnackBarModule, MatCheckboxModule, MatListModule, MatExpansionModule, MatSortModule, MatSelectModule, MatTooltipModule } from '@angular/material'; ======= >>>>>>> <<<<<<< MatButtonModule, MatMenuModule, MatCardModule, MatToolbarModule, MatIconModule, MatFormFieldModule, MatInputModule, MatTableModule, MatDialogModule, MatProgressBarModule, MatProgressSpinnerModule, MatSnackBarModule, MatCheckboxModule, MatListModule, MatExpansionModule, MatSortModule, MatSelectModule, MatTooltipModule, MatStepperModule, ======= >>>>>>> <<<<<<< NgxElectronModule, FileUploadModule ======= NgxElectronModule, ...MATERIAL_IMPORTS >>>>>>> NgxElectronModule, FileUploadModule, MATERIAL_IMPORTS
<<<<<<< getStatistics(server: Server, project_id: string): Observable<any> { return this.httpServer.get(server, `/projects/${project_id}/stats`); } ======= duplicate(server: Server, project_id: string, project_name): Observable<any> { return this.httpServer.post(server, `/projects/${project_id}/duplicate`, { name: project_name }); } >>>>>>> getStatistics(server: Server, project_id: string): Observable<any> { return this.httpServer.get(server, `/projects/${project_id}/stats`); } duplicate(server: Server, project_id: string, project_name): Observable<any> { return this.httpServer.post(server, `/projects/${project_id}/duplicate`, { name: project_name }); }
<<<<<<< import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; ======= import { ShowNodeActionComponent } from './components/project-map/context-menu/actions/show-node-action/show-node-action.component'; import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component'; import { InfoService } from './services/info.service'; >>>>>>> import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; import { ShowNodeActionComponent } from './components/project-map/context-menu/actions/show-node-action/show-node-action.component'; import { InfoDialogComponent } from './components/project-map/info-dialog/info-dialog.component'; import { InfoService } from './services/info.service'; <<<<<<< SaveProjectDialogComponent, ======= InfoDialogComponent, >>>>>>> SaveProjectDialogComponent, InfoDialogComponent, <<<<<<< StartCaptureDialogComponent, SaveProjectDialogComponent ======= StartCaptureDialogComponent, InfoDialogComponent >>>>>>> StartCaptureDialogComponent, SaveProjectDialogComponent, InfoDialogComponent
<<<<<<< import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; ======= import { TopologySummaryComponent } from './components/topology-summary/topology-summary.component'; >>>>>>> import { SaveProjectDialogComponent } from './components/projects/save-project-dialog/save-project-dialog.component'; import { TopologySummaryComponent } from './components/topology-summary/topology-summary.component'; <<<<<<< SaveProjectDialogComponent, ======= TopologySummaryComponent, >>>>>>> SaveProjectDialogComponent, TopologySummaryComponent,
<<<<<<< import { MapScaleService } from './services/mapScale.service'; ======= import { AdbutlerComponent } from './components/adbutler/adbutler.component'; import { ConsoleService } from './services/settings/console.service'; import { DefaultConsoleService } from './services/settings/default-console.service'; import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer'; >>>>>>> import { MapScaleService } from './services/mapScale.service'; import { AdbutlerComponent } from './components/adbutler/adbutler.component'; import { ConsoleService } from './services/settings/console.service'; import { DefaultConsoleService } from './services/settings/default-console.service'; import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer'; <<<<<<< ServerManagementService, MapScaleService ======= ServerManagementService, ConsoleService, DefaultConsoleService, NodeCreatedLabelStylesFixer >>>>>>> ServerManagementService, MapScaleService, ConsoleService, DefaultConsoleService, NodeCreatedLabelStylesFixer
<<<<<<< import { MapSettingService } from './services/mapsettings.service'; ======= import { HelpComponent } from './components/help/help.component'; >>>>>>> import { MapSettingService } from './services/mapsettings.service'; import { HelpComponent } from './components/help/help.component';
<<<<<<< import { DrawLinkToolComponent } from './components/draw-link-tool/draw-link-tool.component'; import { DrawingResizingComponent } from './components/drawing-resizing/drawing-resizing.component'; ======= >>>>>>> import { DrawingResizingComponent } from './components/drawing-resizing/drawing-resizing.component'; <<<<<<< DrawLinkToolComponent, DrawingResizingComponent, ======= >>>>>>> DrawingResizingComponent,
<<<<<<< stocks$: Observable<StockMarketState> = this.store.pipe( select(selectStockMarket) ); ======= routeAnimationsElements = ROUTE_ANIMATIONS_ELEMENTS; initialized; stocks; >>>>>>> stocks$: Observable<StockMarketState> = this.store.pipe( select(selectStockMarket) ); routeAnimationsElements = ROUTE_ANIMATIONS_ELEMENTS;
<<<<<<< ======= import { Child, Context, Index, Lexeme, Parent, Path } from '../types' import { State } from './initialState' >>>>>>> <<<<<<< import { Child, Context, Lexeme, Parent, Path, Timestamp } from '../types' import { GenericObject } from '../utilTypes' import { Block } from '../action-creators/importText' import { State } from './initialState' ======= import { Block } from '../action-creators/importText' >>>>>>> import { Child, Context, Index, Lexeme, Parent, Path, Timestamp } from '../types' import { Block } from '../action-creators/importText' import { State } from './initialState' <<<<<<< export const importJSON = (state: State, thoughtsRanked: Path, blocks: Block[], { lastUpdated = timestamp(), skipRoot = false }: ImportJSONOptions) => { const thoughtIndexUpdates: GenericObject<Lexeme> = {} const contextIndexUpdates: GenericObject<Parent> = {} ======= export const importJSON = (state: State, thoughtsRanked: Path, blocks: Block[], { skipRoot = false }: ImportHtmlOptions) => { const thoughtIndexUpdates: Index<Lexeme> = {} const contextIndexUpdates: Index<Parent> = {} >>>>>>> export const importJSON = (state: State, thoughtsRanked: Path, blocks: Block[], { lastUpdated = timestamp(), skipRoot = false }: ImportJSONOptions) => { const thoughtIndexUpdates: Index<Lexeme> = {} const contextIndexUpdates: Index<Parent> = {}
<<<<<<< /** Get the value of the Child | ThoughtContext. */ const childValue = (child: Child | ThoughtContext) => showContexts ? head((child as ThoughtContext).context) : (child as Child).value const thoughtsRanked = !path || path.length === 0 ? RANKED_ROOT ======= const simplePath = !path || path.length === 0 ? RANKED_ROOT >>>>>>> /** Get the value of the Child | ThoughtContext. */ const childValue = (child: Child | ThoughtContext) => showContexts ? head((child as ThoughtContext).context) : (child as Child).value const simplePath = !path || path.length === 0 ? RANKED_ROOT <<<<<<< const context = pathToContext(thoughtsRanked) const rootedPath = path && path.length > 0 ? path : RANKED_ROOT ======= const context = pathToContext(simplePath) const rootedContext = path && path.length > 0 ? pathToContext(path) : [ROOT_TOKEN] >>>>>>> const context = pathToContext(simplePath) const rootedPath = path && path.length > 0 ? path : RANKED_ROOT <<<<<<< [hashContext(rootedPath)]: rootedPath, ======= [hashContext(rootedContext)]: true, >>>>>>> [hashContext(pathToContext(rootedPath))]: rootedPath,
<<<<<<< export default (state: State, path: Nullable<Path>, contextChain: Child[][] = [], { depth = 0 }: { depth?: number } = {}): GenericObject<Path> => { ======= const expandThoughts = (state: State, path: Path | null, contextChain: Child[][] = [], { depth = 0 }: { depth?: number } = {}): GenericObject<boolean> => { >>>>>>> const expandThoughts = (state: State, path: Path | null, contextChain: Child[][] = [], { depth = 0 }: { depth?: number } = {}): GenericObject<Path> => {
<<<<<<< import { State, ThoughtsInterface, initialState } from '../util/initialState' import { decodeThoughtsUrl, expandThoughts } from '../selectors' import { hashContext, importHtml, isRoot, logWithTime, mergeUpdates, reducerFlow } from '../util' import { CONTEXT_CACHE_SIZE, EM_TOKEN, INITIAL_SETTINGS, ROOT_TOKEN, THOUGHT_CACHE_SIZE } from '../constants' import { Child, Index, Lexeme, Parent } from '../types' ======= import { clearQueue } from '../reducers' import { expandThoughts } from '../selectors' import { logWithTime, mergeUpdates } from '../util' import { State } from '../util/initialState' import { Index, Lexeme, Parent, SimplePath } from '../types' >>>>>>> import { State, ThoughtsInterface, initialState } from '../util/initialState' import { decodeThoughtsUrl, expandThoughts } from '../selectors' import { hashContext, importHtml, isRoot, logWithTime, mergeUpdates, reducerFlow } from '../util' import { CONTEXT_CACHE_SIZE, EM_TOKEN, INITIAL_SETTINGS, ROOT_TOKEN, THOUGHT_CACHE_SIZE } from '../constants' import { Index, Lexeme, Parent, SimplePath } from '../types' <<<<<<< recentlyEdited?: Index<any>, contextChain?: Child[][], ======= recentlyEdited?: Index, contextChain?: SimplePath[], >>>>>>> recentlyEdited?: Index, contextChain?: SimplePath[], <<<<<<< const updateThoughts = (state: State, { thoughtIndexUpdates, contextIndexUpdates, recentlyEdited, contextChain, updates, local = true, remote = true }: Options) => { const contextIndexOld = { ...state.thoughts.contextIndex } const thoughtIndexOld = { ...state.thoughts.thoughtIndex } ======= const updateThoughts = (state: State, { thoughtIndexUpdates, contextIndexUpdates, recentlyEdited, contextChain, updates, local = true, remote = true }: Payload): State => { >>>>>>> const updateThoughts = (state: State, { thoughtIndexUpdates, contextIndexUpdates, recentlyEdited, contextChain, updates, local = true, remote = true }: Options) => { const contextIndexOld = { ...state.thoughts.contextIndex } const thoughtIndexOld = { ...state.thoughts.thoughtIndex } <<<<<<< const thoughts = { contextCache, contextIndex, thoughtCache, thoughtIndex, ======= const stateNew: State = { ...state, recentlyEdited: recentlyEditedNew, syncQueue: syncQueueNew, thoughts: { contextIndex, thoughtIndex, }, >>>>>>> const thoughts = { contextCache, contextIndex, thoughtCache, thoughtIndex,
<<<<<<< import { ImportJSONOptions, importJSON } from './importJSON' ======= import { importJSON } from './importJSON' import { State } from './initialState' import { SimplePath } from '../types' interface ImportHtmlOptions { skipRoot? : boolean, } >>>>>>> import { ImportJSONOptions, importJSON } from './importJSON' import { State } from './initialState' import { SimplePath } from '../types' <<<<<<< export const importHtml = (state: State, thoughtsRanked: Path, html: string, options: ImportJSONOptions = {}) => { ======= export const importHtml = (state: State, simplePath: SimplePath, html: string, { skipRoot }: ImportHtmlOptions = { skipRoot: false }) => { >>>>>>> export const importHtml = (state: State, simplePath: SimplePath, html: string, options: ImportJSONOptions = {}) => { <<<<<<< return importJSON(state, thoughtsRanked, thoughtsJSON, options) ======= return importJSON(state, simplePath, thoughtsJSON, { skipRoot }) >>>>>>> return importJSON(state, simplePath, thoughtsJSON, options)
<<<<<<< import { appendChildPath, getChildPath, getSortPreference, getThought, hasChild } from '../selectors' import { compareByRank, compareThought, hashContext, isFunction, sort, unroot, pathToContext, equalThoughtRanked, head } from '../util' import { Child, ComparatorFunction, Context, ContextHash, ThoughtContext, SimplePath, Path } from '../types' import isContextViewActive from './isContextViewActive' ======= import { getSortPreference, hasChild } from '../selectors' import { compareByRank, compareThought, hashContext, head, isFunction, sort, unroot } from '../util' import { Child, ComparatorFunction, Context, ContextHash } from '../types' >>>>>>> import { appendChildPath, getChildPath, getSortPreference, hasChild } from '../selectors' import { compareByRank, compareThought, hashContext, isFunction, sort, unroot, pathToContext, equalThoughtRanked, head } from '../util' import { Child, ComparatorFunction, Context, ContextHash, ThoughtContext, SimplePath, Path } from '../types' import isContextViewActive from './isContextViewActive'
<<<<<<< import { ActionCreator, Path, Timestamp } from '../types' ======= import { simplifyPath } from '../selectors' import { ActionCreator, Path } from '../types' >>>>>>> import { ActionCreator, Path, Timestamp } from '../types' import { simplifyPath } from '../selectors' <<<<<<< const importText = (thoughtsRanked: Path, inputText: string, { lastUpdated, preventSetCursor, preventSync, rawDestValue, skipRoot }: Options = {}): ActionCreator => (dispatch, getState) => { ======= const importText = (path: Path, inputText: string, { preventSetCursor, preventSync, rawDestValue, skipRoot }: Options = {}): ActionCreator => (dispatch, getState) => { const state = getState() const simplePath = simplifyPath(state, path) >>>>>>> const importText = (path: Path, inputText: string, { lastUpdated, preventSetCursor, preventSync, rawDestValue, skipRoot }: Options = {}): ActionCreator => (dispatch, getState) => { const state = getState() const simplePath = simplifyPath(state, path) <<<<<<< const { lastThoughtFirstLevel, thoughtIndexUpdates, contextIndexUpdates } = importJSON(state, thoughtsRanked, json, { lastUpdated, skipRoot }) ======= const { lastThoughtFirstLevel, thoughtIndexUpdates, contextIndexUpdates } = importJSON(state, simplePath, json, { skipRoot }) >>>>>>> const { lastThoughtFirstLevel, thoughtIndexUpdates, contextIndexUpdates } = importJSON(state, simplePath, json, { lastUpdated, skipRoot }) <<<<<<< ======= callback: () => { // restore the selection to the first imported thought if (!preventSetCursor && lastThoughtFirstLevel && lastThoughtFirstLevel.value) { dispatch({ type: 'setCursor', thoughtsRanked: contextOf(path).concat(lastThoughtFirstLevel), offset: lastThoughtFirstLevel.value.length }) } } >>>>>>>
<<<<<<< import { Alert, Context, Lexeme, Parent, Patch, Path, Snapshot } from '../types' import { GenericObject, Nullable } from '../utilTypes' ======= >>>>>>> <<<<<<< contextIndex: GenericObject<Parent>, contextCache: string[], thoughtIndex: GenericObject<Lexeme>, thoughtCache: string[], ======= thoughtIndex: Index<Lexeme>, contextIndex?: Index<Parent>, >>>>>>> contextCache: string[], contextIndex: Index<Parent>, thoughtCache: string[], thoughtIndex: Index<Lexeme>, <<<<<<< contextViews: GenericObject<boolean>, cursor: Nullable<Path>, cursorBeforeEdit: Nullable<Path>, cursorBeforeSearch: Nullable<Path>, ======= codeView?: Path | null, contextViews: Index<boolean>, cursor: (Path | null), cursorBeforeEdit: (Path | null), cursorBeforeSearch: (Path | null), >>>>>>> contextViews: Index<boolean>, cursor: (Path | null), cursorBeforeEdit: (Path | null), cursorBeforeSearch: (Path | null), <<<<<<< expanded: GenericObject<Path>, ======= expanded: Index<boolean>, >>>>>>> expanded: Index<Path>, <<<<<<< isSyncing?: boolean, lastUpdated?: string, modals: GenericObject<ModalProperties>, ======= modals: Index<ModalProperties>, >>>>>>> isSyncing?: boolean, lastUpdated?: string, modals: Index<ModalProperties>, <<<<<<< ======= syncQueue?: { contextIndexUpdates?: Index<Parent | null>, thoughtIndexUpdates?: Index<Lexeme | null>, recentlyEdited?: RecentlyEditedTree, updates?: Index<string>, local?: boolean, remote?: boolean, }, >>>>>>> <<<<<<< user?: User, userRef?: UserRef, ======= user?: User, userRef?: Ref, patches: Patch[], inversePatches: Patch[], >>>>>>> user?: User, userRef?: Ref,
<<<<<<< import { getThoughtsRanked } from '../selectors' ======= import { getChildrenRanked } from '../selectors' import { Context } from '../types' >>>>>>> import { getChildrenRanked } from '../selectors' <<<<<<< const getStateSetting = (state: State, context: Context | string): string | undefined => (getThoughtsRanked(state, [EM_TOKEN, 'Settings'].concat(context)) ======= const getSetting = (state: State, context: Context | string) => (getChildrenRanked(state, [EM_TOKEN, 'Settings'].concat(context)) >>>>>>> const getStateSetting = (state: State, context: Context | string): string | undefined => (getChildrenRanked(state, [EM_TOKEN, 'Settings'].concat(context))
<<<<<<< import { expect } from 'chai'; import { replicate, range, cycle, repeat } from '../src'; import { iterResult, iterDone } from './utility'; ======= import { assert, expect } from 'chai'; import { range, replicate } from '../src'; import { iterDone, iterResult } from './utility'; >>>>>>> import { assert, expect } from 'chai'; import { replicate, range, cycle, repeat } from '../src'; import { iterResult, iterDone } from './utility';
<<<<<<< function repeat(item: number | string | IterableProtocol): IterableProtocol { if (validateInputTypes(item)) { ======= function repeat( item: number | string | Function | IterableProtocol ): IterableProtocol { if ( typeof item !== 'number' && typeof item !== 'string' && typeof item !== 'function' && !isIterator(item) ) { >>>>>>> function repeat(item: number | string | IterableProtocol): IterableProtocol { if (validateInputTypes(item)) { <<<<<<< if(isRepeatIterator(item as IterableProtocol)) { throw new ArgumentError('Do not use infinite type iterator.'); } let iterable: IterableProtocol; if (typeof item === 'number' || typeof item === 'string') { iterable = new PrimitiveIterator(item); ======= let iterator: IterableProtocol; if (!isIterator(item)) { iterator = new PrimitiveIterator(item); >>>>>>> if(isRepeatIterator(item as IterableProtocol)) { throw new ArgumentError('Do not use infinite type iterator.'); } let iterator: IterableProtocol; if (!isIterator(item)) { iterator = new PrimitiveIterator(item);
<<<<<<< import { LoadInitiationAction, LoadSuccessAction, LoadFailureAction, LoadCancelAction, DefaultAction} from './actions'; ======= import { LoadInitiationAction, LoadSuccessAction, LoadFailureAction, LoadCancelAction, ClearErrorAction, } from './actions'; >>>>>>> import { LoadInitiationAction, LoadSuccessAction, LoadFailureAction, LoadCancelAction, ClearErrorAction, DefaultAction, } from './actions'; <<<<<<< export const defaultAction = (): DefaultAction => ({ type: types.DEFAULT_ACTION_TYPE, }); ======= export const clearError = (): ClearErrorAction => ({ type: types.CLEAR_ERROR, }); >>>>>>> export const clearError = (): ClearErrorAction => ({ type: types.CLEAR_ERROR, }); export const defaultAction = (): DefaultAction => ({ type: types.DEFAULT_ACTION_TYPE, }); <<<<<<< defaultAction, ======= clearError, >>>>>>> clearError, defaultAction,
<<<<<<< import Hero from './Hero'; import Button from './Button'; import Article from './Article'; import Footer from './Footer'; import Paragraph from './Paragraph'; import SvgIcon from './SvgIcon'; import Anchor from './Anchor'; import Markdown from './Markdown'; import Headline from './Headline'; import LoadingIndicator from './LoadingIndicator'; import Avatar from './Avatar'; import Pic from './Pic'; ======= >>>>>>> import Pic from './Pic'; <<<<<<< Hero, Button, Article, Footer, Paragraph, SvgIcon, Anchor, Markdown, Headline, LoadingIndicator, Pic, ======= >>>>>>> Pic,
<<<<<<< 'typings/main.d.ts', join(APP_SRC, '**/*.ts'), '!' + join(APP_SRC, '**/*.e2e.ts'), '!' + join(APP_SRC, 'main.ts') ]; ======= join(APP_SRC, '**/*.ts'), '!' + join(APP_SRC, `${BOOTSTRAP_MODULE}.ts`) ]; >>>>>>> 'typings/main.d.ts', join(APP_SRC, '**/*.ts'), '!' + join(APP_SRC, '**/*.e2e.ts'), '!' + join(APP_SRC, `${BOOTSTRAP_MODULE}.ts`) ];
<<<<<<< } export interface PageResponse { offset: number; length: number; total:number; exact: boolean; } export enum DataStatus { UNLOCKED= "Unlocked", LOCKED="Locked", DELETED="Deleted"; } export interface DataItem { id: number; feedName:string; typeName:string; pipelineUuid: string; parentDataId: number; processTaskId:number; processorId:number; status:DataStatus; statusMs: number; createMs: number; effectiveMs: number; } export interface DataRow { data: DataItem; attributes: { [key: string]: string; } } export interface StreamAttributeMapResult { pageResponse: PageResponse; streamAttributeMaps: Array<DataRow>; ======= } export enum PermissionInheritance { NONE = "None", SOURCE = "Source", DESTINATION = "Destination", COMBINED = "Combined" >>>>>>> } export interface PageResponse { offset: number; length: number; total:number; exact: boolean; } export enum DataStatus { UNLOCKED= "Unlocked", LOCKED="Locked", DELETED="Deleted"; } export interface DataItem { id: number; feedName:string; typeName:string; pipelineUuid: string; parentDataId: number; processTaskId:number; processorId:number; status:DataStatus; statusMs: number; createMs: number; effectiveMs: number; } export interface DataRow { data: DataItem; attributes: { [key: string]: string; } } export interface StreamAttributeMapResult { pageResponse: PageResponse; streamAttributeMaps: Array<DataRow>; } export enum PermissionInheritance { NONE = "None", SOURCE = "Source", DESTINATION = "Destination", COMBINED = "Combined"
<<<<<<< Rider = 'Rider', ======= AndroidStudio = 'Android Studio', >>>>>>> AndroidStudio = 'Android Studio', Rider = 'Rider', <<<<<<< if (label === ExternalEditor.Rider) { return ExternalEditor.Rider } ======= if (label === ExternalEditor.AndroidStudio) { return ExternalEditor.AndroidStudio } >>>>>>> if (label === ExternalEditor.AndroidStudio) { return ExternalEditor.AndroidStudio } if (label === ExternalEditor.Rider) { return ExternalEditor.Rider } <<<<<<< case ExternalEditor.Rider: return ['com.jetbrains.rider'] ======= case ExternalEditor.AndroidStudio: return ['com.google.android.studio'] >>>>>>> case ExternalEditor.AndroidStudio: return ['com.google.android.studio'] case ExternalEditor.Rider: return ['com.jetbrains.rider'] <<<<<<< case ExternalEditor.Rider: return Path.join(installPath, 'Contents', 'MacOS', 'rider') ======= case ExternalEditor.AndroidStudio: return Path.join(installPath, 'Contents', 'MacOS', 'studio') >>>>>>> case ExternalEditor.AndroidStudio: return Path.join(installPath, 'Contents', 'MacOS', 'studio') case ExternalEditor.Rider: return Path.join(installPath, 'Contents', 'MacOS', 'rider') <<<<<<< riderPath, ======= androidStudioPath, >>>>>>> androidStudioPath, riderPath, <<<<<<< findApplication(ExternalEditor.Rider), ======= findApplication(ExternalEditor.AndroidStudio), >>>>>>> findApplication(ExternalEditor.AndroidStudio), findApplication(ExternalEditor.Rider), <<<<<<< if (riderPath) { results.push({ editor: ExternalEditor.Rider, path: riderPath }) } ======= if (androidStudioPath) { results.push({ editor: ExternalEditor.AndroidStudio, path: androidStudioPath, }) } >>>>>>> if (androidStudioPath) { results.push({ editor: ExternalEditor.AndroidStudio, path: androidStudioPath, }) } if (riderPath) { results.push({ editor: ExternalEditor.Rider, path: riderPath }) }
<<<<<<< formState: { kind: HistoryTabMode.History, }, ======= formState: { kind: ComparisonView.None }, tip: null, >>>>>>> formState: { kind: HistoryTabMode.History, }, tip: null,
<<<<<<< const args = [...gitNetworkArguments, 'lfs', 'clone', '--recursive'] ======= const args = [ ...gitNetworkArguments, 'lfs', 'clone', '--recursive', '--progress', // git-lfs will create the hooks it requires by default // and we don't know if the repository is LFS enabled // at this stage so let's not do this '--skip-repo', ] >>>>>>> const args = [ ...gitNetworkArguments, 'lfs', 'clone', '--recursive', // git-lfs will create the hooks it requires by default // and we don't know if the repository is LFS enabled // at this stage so let's not do this '--skip-repo', ]
<<<<<<< import moment = require('moment') ======= import { MenuLabelsEvent } from '../../models/menu-labels' >>>>>>> import moment = require('moment') import { MenuLabelsEvent } from '../../models/menu-labels' <<<<<<< private async updateStashEntryCountMetric( repository: Repository, gitStore: GitStore ) { const lastStashEntryCheck = await this.repositoriesStore.getLastStashCheckDate( repository ) const dateNow = moment() const threshold = dateNow.subtract(24, 'hours') if (lastStashEntryCheck == null || threshold.isAfter(lastStashEntryCheck)) { await this.repositoriesStore.updateLastStashCheckDate(repository) // `lastStashEntryCheck` being equal to null means we've never checked for // the given repo const { stashEntryCount, desktopStashEntryCount } = gitStore const numEntriesCreatedOutsideDesktop = stashEntryCount - desktopStashEntryCount this.statsStore.addStashesCreatedOutsideDesktop( numEntriesCreatedOutsideDesktop ) } } public refreshAllIndicators() { return this.refreshIndicatorsForRepositories(this.repositories, true) ======= /** * Update the repository sidebar indicator for the repository */ private async updateSidebarIndicator( repository: Repository, status: IStatusResult | null ): Promise<void> { const lookup = this.localRepositoryStateLookup if (repository.missing) { lookup.delete(repository.id) return } if (status === null) { lookup.delete(repository.id) return } lookup.set(repository.id, { aheadBehind: status.branchAheadBehind || null, changedFilesCount: status.workingDirectory.files.length, }) >>>>>>> private async updateStashEntryCountMetric( repository: Repository, gitStore: GitStore ) { const lastStashEntryCheck = await this.repositoriesStore.getLastStashCheckDate( repository ) const dateNow = moment() const threshold = dateNow.subtract(24, 'hours') if (lastStashEntryCheck == null || threshold.isAfter(lastStashEntryCheck)) { await this.repositoriesStore.updateLastStashCheckDate(repository) // `lastStashEntryCheck` being equal to null means we've never checked for // the given repo const { stashEntryCount, desktopStashEntryCount } = gitStore const numEntriesCreatedOutsideDesktop = stashEntryCount - desktopStashEntryCount this.statsStore.addStashesCreatedOutsideDesktop( numEntriesCreatedOutsideDesktop ) } } /** * Update the repository sidebar indicator for the repository */ private async updateSidebarIndicator( repository: Repository, status: IStatusResult | null ): Promise<void> { const lookup = this.localRepositoryStateLookup if (repository.missing) { lookup.delete(repository.id) return } if (status === null) { lookup.delete(repository.id) return } lookup.set(repository.id, { aheadBehind: status.branchAheadBehind || null, changedFilesCount: status.workingDirectory.files.length, })
<<<<<<< /** Clear the contextual commit message. */ public clearContextualCommitMessage(): Promise<void> { this._contextualCommitMessage = null this.emitUpdate() return Promise.resolve() } ======= >>>>>>>
<<<<<<< } /** Should the app check and warn the user about committing large files? */ export function enableFileSizeWarningCheck(): boolean { return enableDevelopmentFeatures() ======= } /** Should the app use the MergeConflictsDialog component and flow? */ export function enableMergeConflictsDialog(): boolean { return enableBetaFeatures() >>>>>>> } /** Should the app check and warn the user about committing large files? */ export function enableFileSizeWarningCheck(): boolean { return enableDevelopmentFeatures() } /** Should the app use the MergeConflictsDialog component and flow? */ export function enableMergeConflictsDialog(): boolean { return enableBetaFeatures()
<<<<<<< label: __DARWIN__ ? 'Compare on GitHub' : 'Compare on &GitHub', id: 'compare-branch-github', ======= label: __DARWIN__ ? 'Compare on GitHub' : '&Compare on GitHub', id: 'compare-on-github', >>>>>>> label: __DARWIN__ ? 'Compare on GitHub' : 'Compare on &GitHub', id: 'compare-on-github',
<<<<<<< /** This shouldn't be called directly. See `Dispatcher`. */ public _openShell(path: string) { return openShell(path) } ======= /** This shouldn't be called directly. See `Dispatcher`. */ public async _setGitIgnoreText(repository: Repository, text: string): Promise<void> { const gitStore = this.getGitStore(repository) await gitStore.setGitIgnoreText(text) return this._refreshRepository(repository) } /** This shouldn't be called directly. See `Dispatcher`. */ public async _refreshGitIgnore(repository: Repository): Promise<void> { const gitStore = this.getGitStore(repository) return gitStore.refreshGitIgnoreText() } /** Takes a URL and opens it using the system default application */ public _openInBrowser(url: string) { return shell.openExternal(url) } >>>>>>> /** This shouldn't be called directly. See `Dispatcher`. */ public _openShell(path: string) { return openShell(path) } /** This shouldn't be called directly. See `Dispatcher`. */ public async _setGitIgnoreText(repository: Repository, text: string): Promise<void> { const gitStore = this.getGitStore(repository) await gitStore.setGitIgnoreText(text) return this._refreshRepository(repository) } /** This shouldn't be called directly. See `Dispatcher`. */ public async _refreshGitIgnore(repository: Repository): Promise<void> { const gitStore = this.getGitStore(repository) return gitStore.refreshGitIgnoreText() } /** Takes a URL and opens it using the system default application */ public _openInBrowser(url: string) { return shell.openExternal(url) }
<<<<<<< describe('cherry picking with conflicts', () => { beforeEach(async () => { // In the 'git/cherry-pick' `beforeEach`, we call `createRepository` which // adds a commit to the feature branch with a file called THING.md. In // order to make a conflict, we will add the same file to the target // branch. const conflictingCommit = { commitMessage: 'Conflicting Commit!', entries: [ { path: 'THING.md', contents: '# HELLO WORLD! \n CREATING CONFLICT! FUN TIMES!\n', }, ], } await makeCommit(repository, conflictingCommit) }) it('successfully detect cherry pick with conflicts', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continue cherry pick with conflicts after resolving them', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory const diffCheckBefore = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckBefore.exitCode).toBeGreaterThan(0) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) const diffCheckAfter = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckAfter.exitCode).toEqual(0) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) }) it('successfully detect cherry pick with outstanding files not staged', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) result = await continueCherryPick(repository, []) expect(result).toBe(CherryPickResult.OutstandingFilesNotStaged) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continue cherry pick with additional changes unrelated to conflicted files', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) // change files unrelated to conflicts await FSE.writeFile( Path.join(repository.path, 'UNRELATED_FILE.md'), '# HELLO WORLD! \nUNRELATED FILE STUFF IN HERE\n' ) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory // THING.MD and UNRELEATED_FILE.md should be in working directory expect(files.length).toBe(2) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) // Only UNRELATED_FILE.md should be in working directory // THING.md committed with cherry pick const status = await getStatusOrThrow(repository) expect(status.workingDirectory.files[0].path).toBe('UNRELATED_FILE.md') }) it('successfully abort cherry pick after conflict', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // files from cherry pick exist in conflicted state const statusAfterConflict = await getStatusOrThrow(repository) expect(statusAfterConflict.workingDirectory.files).toHaveLength(1) await abortCherryPick(repository) // file from cherry pick removed after abort const statusAfterAbort = await getStatusOrThrow(repository) expect(statusAfterAbort.workingDirectory.files).toHaveLength(0) }) }) describe('cherry picking progress', () => { fit('can parse progress', async () => { const progress = new Array<ICherryPickProgress>() result = await cherryPick(repository, featureBranch.tip.sha, p => progress.push(p) ) expect(result).toBe(CherryPickResult.CompletedWithoutError) expect(progress).toEqual([ { currentCommitSummary: 'Cherry Picked Feature!', kind: 'cherryPick', cherryPickCommitCount: 1, title: 'Cherry picking commit 1 of 1 commits', totalCommitCount: 1, value: 1, }, ]) }) }) ======= describe('cherry picking with conflicts', () => { beforeEach(async () => { // In the 'git/cherry-pick' `beforeEach`, we call `createRepository` which // adds a commit to the feature branch with a file called THING.md. In // order to make a conflict, we will add the same file to the target // branch. const conflictingCommit = { commitMessage: 'Conflicting Commit!', entries: [ { path: 'THING.md', contents: '# HELLO WORLD! \n CREATING CONFLICT! FUN TIMES!\n', }, ], } await makeCommit(repository, conflictingCommit) }) it('successfully detects cherry pick with conflicts', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continues cherry picking with conflicts after resolving them', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory // git diff --check warns if conflict markers exist and will exit with // non-zero status if conflicts found const diffCheckBefore = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckBefore.exitCode).toBeGreaterThan(0) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) // diff --check to verify no conflicts exist (exitCode should be 0) const diffCheckAfter = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckAfter.exitCode).toEqual(0) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) }) it('successfully detects cherry picking with outstanding files not staged', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) result = await continueCherryPick(repository, []) expect(result).toBe(CherryPickResult.OutstandingFilesNotStaged) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continues cherry picking with additional changes to untracked files', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) // changes to untracked file await FSE.writeFile( Path.join(repository.path, 'UNTRACKED_FILE.md'), '# HELLO WORLD! \nUNTRACKED FILE STUFF IN HERE\n' ) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory // THING.MD and UNTRACKED_FILE.md should be in working directory expect(files.length).toBe(2) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) // Only UNTRACKED_FILE.md should be in working directory // THING.md committed with cherry pick const status = await getStatusOrThrow(repository) expect(status.workingDirectory.files[0].path).toBe('UNTRACKED_FILE.md') }) it('successfully aborts cherry pick after conflict', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // files from cherry pick exist in conflicted state const statusAfterConflict = await getStatusOrThrow(repository) expect(statusAfterConflict.workingDirectory.files).toHaveLength(1) await abortCherryPick(repository) // file from cherry pick removed after abort const statusAfterAbort = await getStatusOrThrow(repository) expect(statusAfterAbort.workingDirectory.files).toHaveLength(0) }) }) >>>>>>> describe('cherry picking with conflicts', () => { beforeEach(async () => { // In the 'git/cherry-pick' `beforeEach`, we call `createRepository` which // adds a commit to the feature branch with a file called THING.md. In // order to make a conflict, we will add the same file to the target // branch. const conflictingCommit = { commitMessage: 'Conflicting Commit!', entries: [ { path: 'THING.md', contents: '# HELLO WORLD! \n CREATING CONFLICT! FUN TIMES!\n', }, ], } await makeCommit(repository, conflictingCommit) }) it('successfully detects cherry pick with conflicts', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continues cherry picking with conflicts after resolving them', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory // git diff --check warns if conflict markers exist and will exit with // non-zero status if conflicts found const diffCheckBefore = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckBefore.exitCode).toBeGreaterThan(0) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) // diff --check to verify no conflicts exist (exitCode should be 0) const diffCheckAfter = await GitProcess.exec( ['diff', '--check'], repository.path ) expect(diffCheckAfter.exitCode).toEqual(0) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) }) it('successfully detects cherry picking with outstanding files not staged', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) result = await continueCherryPick(repository, []) expect(result).toBe(CherryPickResult.OutstandingFilesNotStaged) const status = await getStatusOrThrow(repository) const conflictedFiles = status.workingDirectory.files.filter( f => f.status.kind === AppFileStatusKind.Conflicted ) expect(conflictedFiles).toHaveLength(1) }) it('successfully continues cherry picking with additional changes to untracked files', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // resolve conflicts by writing files to disk await FSE.writeFile( Path.join(repository.path, 'THING.md'), '# HELLO WORLD! \nTHINGS GO HERE\nFEATURE BRANCH UNDERWAY\n' ) // changes to untracked file await FSE.writeFile( Path.join(repository.path, 'UNTRACKED_FILE.md'), '# HELLO WORLD! \nUNTRACKED FILE STUFF IN HERE\n' ) const statusAfterCherryPick = await getStatusOrThrow(repository) const { files } = statusAfterCherryPick.workingDirectory // THING.MD and UNTRACKED_FILE.md should be in working directory expect(files.length).toBe(2) result = await continueCherryPick(repository, files) expect(result).toBe(CherryPickResult.CompletedWithoutError) // Only UNTRACKED_FILE.md should be in working directory // THING.md committed with cherry pick const status = await getStatusOrThrow(repository) expect(status.workingDirectory.files[0].path).toBe('UNTRACKED_FILE.md') }) it('successfully aborts cherry pick after conflict', async () => { result = await cherryPick(repository, featureBranch.tip.sha) expect(result).toBe(CherryPickResult.ConflictsEncountered) // files from cherry pick exist in conflicted state const statusAfterConflict = await getStatusOrThrow(repository) expect(statusAfterConflict.workingDirectory.files).toHaveLength(1) await abortCherryPick(repository) // file from cherry pick removed after abort const statusAfterAbort = await getStatusOrThrow(repository) expect(statusAfterAbort.workingDirectory.files).toHaveLength(0) }) }) describe('cherry picking progress', () => { fit('can parse progress', async () => { const progress = new Array<ICherryPickProgress>() result = await cherryPick(repository, featureBranch.tip.sha, p => progress.push(p) ) expect(result).toBe(CherryPickResult.CompletedWithoutError) expect(progress).toEqual([ { currentCommitSummary: 'Cherry Picked Feature!', kind: 'cherryPick', cherryPickCommitCount: 1, title: 'Cherry picking commit 1 of 1 commits', totalCommitCount: 1, value: 1, }, ]) }) })
<<<<<<< import { inferComparisonBranch } from './helpers/infer-comparison-branch' import { ApplicationTheme, getThemeName } from '../../ui/lib/application-theme' ======= import { ApplicationTheme, getPersistedTheme, setPersistedTheme, } from '../../ui/lib/application-theme' >>>>>>> import { inferComparisonBranch } from './helpers/infer-comparison-branch' import { ApplicationTheme, getPersistedTheme, setPersistedTheme, } from '../../ui/lib/application-theme'
<<<<<<< private _contextualCommitMessage: ICommitMessage | null = null private _aheadBehind: IAheadBehind | null = null private _remoteName: string | null = null ======= private _commitMessage: ICommitMessage | null private _contextualCommitMessage: ICommitMessage | null >>>>>>> private _commitMessage: ICommitMessage | null private _contextualCommitMessage: ICommitMessage | null private _aheadBehind: IAheadBehind | null = null private _remoteName: string | null = null <<<<<<< /** Calculate the ahead/behind for the current branch. */ public async calculateAheadBehindForCurrentBranch(): Promise<void> { const branch = this._currentBranch if (!branch) { return } this._aheadBehind = await LocalGitOperations.getBranchAheadBehind(this.repository, branch) this.emitUpdate() } /** Load the default remote. */ public async loadDefaultRemote(): Promise<void> { this._remoteName = await LocalGitOperations.getDefaultRemote(this.repository) this.emitUpdate() } /** * The number of commits the current branch is ahead and behind, relative to * its upstream. * * It will be `null` if ahead/behind hasn't been calculated yet, or if the * branch doesn't have an upstream. */ public get aheadBehind(): IAheadBehind | null { return this._aheadBehind } /** Get the name of the remote we're working with. */ public get remoteName(): string | null { return this._remoteName } ======= public setCommitMessage(message: ICommitMessage | null): Promise<void> { this._commitMessage = message this.emitUpdate() return Promise.resolve() } >>>>>>> /** Calculate the ahead/behind for the current branch. */ public async calculateAheadBehindForCurrentBranch(): Promise<void> { const branch = this._currentBranch if (!branch) { return } this._aheadBehind = await LocalGitOperations.getBranchAheadBehind(this.repository, branch) this.emitUpdate() } /** Load the default remote. */ public async loadDefaultRemote(): Promise<void> { this._remoteName = await LocalGitOperations.getDefaultRemote(this.repository) this.emitUpdate() } /** * The number of commits the current branch is ahead and behind, relative to * its upstream. * * It will be `null` if ahead/behind hasn't been calculated yet, or if the * branch doesn't have an upstream. */ public get aheadBehind(): IAheadBehind | null { return this._aheadBehind } /** Get the name of the remote we're working with. */ public get remoteName(): string | null { return this._remoteName } public setCommitMessage(message: ICommitMessage | null): Promise<void> { this._commitMessage = message this.emitUpdate() return Promise.resolve() }
<<<<<<< RenameBranch, ======= DeleteBranch, >>>>>>> RenameBranch, DeleteBranch,
<<<<<<< /** End the Welcome flow. */ public endWelcomeFlow(): Promise<void> { return this.appStore._endWelcomeFlow() } ======= /** * Set the commit summary and description for a work-in-progress * commit in the changes view for a particular repository. */ public setCommitMessage(repository: Repository, message: ICommitMessage | null): Promise<void> { return this.appStore._setCommitMessage(repository, message) } >>>>>>> /** End the Welcome flow. */ public endWelcomeFlow(): Promise<void> { return this.appStore._endWelcomeFlow() } /** * Set the commit summary and description for a work-in-progress * commit in the changes view for a particular repository. */ public setCommitMessage(repository: Repository, message: ICommitMessage | null): Promise<void> { return this.appStore._setCommitMessage(repository, message) }
<<<<<<< /** * Set the width of the repository sidebar to the given * value. This affects the changes and history sidebar * as well as the first toolbar section which contains * repo selection on all platforms and repo selection and * app menu on Windows. */ public setSidebarWidth(width: number): Promise<void> { return this.appStore._setSidebarWidth(width) } /** * Reset the width of the repository sidebar to its default * value. This affects the changes and history sidebar * as well as the first toolbar section which contains * repo selection on all platforms and repo selection and * app menu on Windows. */ public resetSidebarWidth(): Promise<void> { return this.appStore._resetSidebarWidth() } ======= /** Update the repository's issues from GitHub. */ public updateIssues(repository: GitHubRepository): Promise<void> { return this.appStore._updateIssues(repository) } >>>>>>> /** * Set the width of the repository sidebar to the given * value. This affects the changes and history sidebar * as well as the first toolbar section which contains * repo selection on all platforms and repo selection and * app menu on Windows. */ public setSidebarWidth(width: number): Promise<void> { return this.appStore._setSidebarWidth(width) } /** * Reset the width of the repository sidebar to its default * value. This affects the changes and history sidebar * as well as the first toolbar section which contains * repo selection on all platforms and repo selection and * app menu on Windows. */ public resetSidebarWidth(): Promise<void> { return this.appStore._resetSidebarWidth() } /** Update the repository's issues from GitHub. */ public updateIssues(repository: GitHubRepository): Promise<void> { return this.appStore._updateIssues(repository) }
<<<<<<< RenameBranch, ======= PublishRepository, >>>>>>> RenameBranch, PublishRepository,
<<<<<<< import { remote, shell } from 'electron' ======= import { ipcRenderer, remote } from 'electron' >>>>>>> import { remote } from 'electron' <<<<<<< ======= import { uuid } from '../uuid' import { shell } from './app-shell' >>>>>>> import { shell } from './app-shell'
<<<<<<< TextMate = 'TextMate', ======= RubyMine = 'RubyMine', >>>>>>> RubyMine = 'RubyMine', TextMate = 'TextMate', <<<<<<< if (label === ExternalEditor.TextMate) { return ExternalEditor.TextMate } ======= if (label === ExternalEditor.RubyMine) { return ExternalEditor.RubyMine } >>>>>>> if (label === ExternalEditor.RubyMine) { return ExternalEditor.RubyMine } if (label === ExternalEditor.TextMate) { return ExternalEditor.TextMate } <<<<<<< case ExternalEditor.TextMate: return ['com.macromates.TextMate'] ======= case ExternalEditor.RubyMine: return ['com.jetbrains.RubyMine'] >>>>>>> case ExternalEditor.RubyMine: return ['com.jetbrains.RubyMine'] case ExternalEditor.TextMate: return ['com.macromates.TextMate'] <<<<<<< case ExternalEditor.TextMate: return Path.join(installPath, 'Contents', 'Resources', 'mate') ======= case ExternalEditor.RubyMine: return Path.join(installPath, 'Contents', 'MacOS', 'rubymine') >>>>>>> case ExternalEditor.RubyMine: return Path.join(installPath, 'Contents', 'MacOS', 'rubymine') case ExternalEditor.TextMate: return Path.join(installPath, 'Contents', 'Resources', 'mate') <<<<<<< textMatePath, ======= rubyMinePath, >>>>>>> rubyMinePath, textMatePath, <<<<<<< findApplication(ExternalEditor.TextMate), ======= findApplication(ExternalEditor.RubyMine), >>>>>>> findApplication(ExternalEditor.RubyMine), findApplication(ExternalEditor.TextMate), <<<<<<< if (textMatePath) { results.push({ editor: ExternalEditor.TextMate, path: textMatePath }) } ======= if (rubyMinePath) { results.push({ editor: ExternalEditor.RubyMine, path: rubyMinePath }) } >>>>>>> if (rubyMinePath) { results.push({ editor: ExternalEditor.RubyMine, path: rubyMinePath }) } if (textMatePath) { results.push({ editor: ExternalEditor.TextMate, path: textMatePath }) }
<<<<<<< | CommitsChosenStep ======= | HideConflictsStep >>>>>>> | CommitsChosenStep | HideConflictsStep <<<<<<< } /** * Shape of data for when a user has chosen commits to cherry pick but not yet * selected a target branch. */ export type CommitsChosenStep = { readonly kind: CherryPickStepKind.CommitsChosen commits: ReadonlyArray<CommitOneLine> ======= } /** Shape of data to track when user hides conflicts dialog */ export type HideConflictsStep = { readonly kind: CherryPickStepKind.HideConflicts >>>>>>> } /** Shape of data to track when user hides conflicts dialog */ export type HideConflictsStep = { readonly kind: CherryPickStepKind.HideConflicts } /** * Shape of data for when a user has chosen commits to cherry pick but not yet * selected a target branch. */ export type CommitsChosenStep = { readonly kind: CherryPickStepKind.CommitsChosen commits: ReadonlyArray<CommitOneLine>
<<<<<<< import { enableCompareSidebar, enableRepoInfoIndicators } from '../feature-flag' ======= import { enableCompareSidebar } from '../feature-flag' import { ApplicationTheme, getPersistedTheme, setPersistedTheme, } from '../../ui/lib/application-theme' >>>>>>> import { enableCompareSidebar, enableRepoInfoIndicators } from '../feature-flag' import { ApplicationTheme, getPersistedTheme, setPersistedTheme, } from '../../ui/lib/application-theme'
<<<<<<< branchComparisons: 0, defaultBranchComparisons: 0, mergesInitiatedFromComparison: 0, updateFromDefaultBranchMenuCount: 0, mergeIntoCurrentBranchMenuCount: 0, ======= prBranchCheckouts: 0, >>>>>>> branchComparisons: 0, defaultBranchComparisons: 0, mergesInitiatedFromComparison: 0, updateFromDefaultBranchMenuCount: 0, mergeIntoCurrentBranchMenuCount: 0, prBranchCheckouts: 0, <<<<<<< /** Record that a branch comparison has been made */ public recordBranchComparison(): Promise<void> { return this.updateDailyMeasures(m => ({ branchComparisons: m.branchComparisons + 1, })) } /** Record that a branch comparison has been made to the `master` branch */ public recordBranchComparisonToMaster(): Promise<void> { return this.updateDailyMeasures(m => ({ defaultBranchComparisons: m.defaultBranchComparisons + 1, })) } /** Record that a merge has been initated from the `compare` sidebar */ public recordCompareInitatedMerge(): Promise<void> { return this.updateDailyMeasures(m => ({ mergesInitiatedFromComparison: m.mergesInitiatedFromComparison + 1, })) } /** Record that a merge has been initated from the `Branch -> Update From Default Branch` menu item */ public recordMenuInitatedUpdate(): Promise<void> { return this.updateDailyMeasures(m => ({ updateFromDefaultBranchMenuCount: m.updateFromDefaultBranchMenuCount + 1, })) } /** Record that a merge has been initated from the `Branch -> Merge Into Current Branch` menu item */ public recordMenuInitatedMerge(): Promise<void> { return this.updateDailyMeasures(m => ({ mergeIntoCurrentBranchMenuCount: m.mergeIntoCurrentBranchMenuCount + 1, })) } ======= /** Record that the user checked out a PR branch */ public recordPRBranchCheckout(): Promise<void> { return this.updateDailyMeasures(m => ({ prBranchCheckouts: m.prBranchCheckouts + 1, })) } >>>>>>> /** Record that a branch comparison has been made */ public recordBranchComparison(): Promise<void> { return this.updateDailyMeasures(m => ({ branchComparisons: m.branchComparisons + 1, })) } /** Record that a branch comparison has been made to the `master` branch */ public recordBranchComparisonToMaster(): Promise<void> { return this.updateDailyMeasures(m => ({ defaultBranchComparisons: m.defaultBranchComparisons + 1, })) } /** Record that a merge has been initated from the `compare` sidebar */ public recordCompareInitatedMerge(): Promise<void> { return this.updateDailyMeasures(m => ({ mergesInitiatedFromComparison: m.mergesInitiatedFromComparison + 1, })) } /** Record that a merge has been initated from the `Branch -> Update From Default Branch` menu item */ public recordMenuInitatedUpdate(): Promise<void> { return this.updateDailyMeasures(m => ({ updateFromDefaultBranchMenuCount: m.updateFromDefaultBranchMenuCount + 1, })) } /** Record that a merge has been initated from the `Branch -> Merge Into Current Branch` menu item */ public recordMenuInitatedMerge(): Promise<void> { return this.updateDailyMeasures(m => ({ mergeIntoCurrentBranchMenuCount: m.mergeIntoCurrentBranchMenuCount + 1, })) } /** Record that the user checked out a PR branch */ public recordPRBranchCheckout(): Promise<void> { return this.updateDailyMeasures(m => ({ prBranchCheckouts: m.prBranchCheckouts + 1, })) }
<<<<<<< const user = this.accounts.find(a => a.endpoint === repository.endpoint) ======= const user = getUserForEndpoint(this.users, repository.endpoint) >>>>>>> const user = getAccountForEndpoint(this.accounts, repository.endpoint) <<<<<<< const fetcher = new BackgroundFetcher(repository, account, r => this.fetch(r)) ======= const fetcher = new BackgroundFetcher(repository, user, r => this.fetch(r, user)) >>>>>>> const fetcher = new BackgroundFetcher(repository, account, r => this.fetch(r, account)) <<<<<<< const accounts = this.accounts const account = getAccountForEndpoint(accounts, gitHubRepository.endpoint) if (!account) { return repository } ======= const user = this.getUserForRepository(repository) if (!user) { return updatedRepository } >>>>>>> const account = this.getAccountForRepository(repository) if (!account) { return updatedRepository } <<<<<<< return remote ? matchGitHubRepository(this.accounts, remote) : null ======= return remote ? matchGitHubRepository(this.users, remote.url) : null >>>>>>> return remote ? matchGitHubRepository(this.accounts, remote.url) : null <<<<<<< const account = this.getAccountForRepository(repository) ======= >>>>>>> <<<<<<< const account = this.getAccountForRepository(repository) ======= >>>>>>> <<<<<<< const account = this.getAccountForRepository(repository) return gitStore.performFailableOperation(() => pullRepo(repository, account, remote.name, branch.name)) ======= return gitStore.performFailableOperation(() => pullRepo(repository, user, remote.name, branch.name)) >>>>>>> return gitStore.performFailableOperation(() => pullRepo(repository, account, remote.name, branch.name)) <<<<<<< private getAccountForRepository(repository: Repository): Account | null { ======= /** Get the authenticated user for the repository. */ public getUserForRepository(repository: Repository): User | null { >>>>>>> /** Get the authenticated user for the repository. */ public getAccountForRepository(repository: Repository): Account | null { <<<<<<< const account = this.getAccountForRepository(repository) await gitStore.fetch(account) ======= await gitStore.fetch(user) >>>>>>> await gitStore.fetch(user)
<<<<<<< } /** * Handler for when we attempt to checkout a branch and there are some files that would * be overwritten. */ export async function localChangesOverwrittenHandler( error: Error, dispatcher: Dispatcher ): Promise<Error | null> { const e = asErrorWithMetadata(error) if (!e) { return error } const gitError = asGitError(e.underlyingError) if (!gitError) { return error } const dugiteError = gitError.result.gitError if (!dugiteError) { return error } if (dugiteError !== DugiteError.LocalChangesOverwritten) { return error } const { repository, gitContext } = e.metadata if (repository == null) { return error } if (!(repository instanceof Repository)) { return error } if (!enableStashing()) { return error } if (gitContext == null) { return error } if (gitContext.kind !== 'checkout') { return error } const { branchToCheckout } = gitContext await dispatcher.moveChangesToBranchAndCheckout(repository, branchToCheckout) return null ======= } /** * Handler for when we attempt to checkout a branch and there are some files that would * be overwritten. */ export async function localChangesOverwrittenHandler( error: Error, dispatcher: Dispatcher ): Promise<Error | null> { const e = asErrorWithMetadata(error) if (!e) { return error } const gitError = asGitError(e.underlyingError) if (!gitError) { return error } const dugiteError = gitError.result.gitError if (!dugiteError) { return error } if (dugiteError !== DugiteError.LocalChangesOverwritten) { return error } const { repository } = e.metadata if (repository == null) { return error } if (!(repository instanceof Repository)) { return error } dispatcher.recordErrorWhenSwitchingBranchesWithUncommmittedChanges() return error >>>>>>> } /** * Handler for when we attempt to checkout a branch and there are some files that would * be overwritten. */ export async function localChangesOverwrittenHandler( error: Error, dispatcher: Dispatcher ): Promise<Error | null> { const e = asErrorWithMetadata(error) if (!e) { return error } const gitError = asGitError(e.underlyingError) if (!gitError) { return error } const dugiteError = gitError.result.gitError if (!dugiteError) { return error } if (dugiteError !== DugiteError.LocalChangesOverwritten) { return error } const { repository, gitContext } = e.metadata if (repository == null) { return error } if (!(repository instanceof Repository)) { return error } if (!enableStashing()) { dispatcher.recordErrorWhenSwitchingBranchesWithUncommmittedChanges() return error } if (gitContext == null) { return error } if (gitContext.kind !== 'checkout') { return error } const { branchToCheckout } = gitContext await dispatcher.moveChangesToBranchAndCheckout(repository, branchToCheckout) return null
<<<<<<< } /** Should the app try and detect conflicts before the user stumbles into them? */ export function enableMergeConflictDetection(): boolean { return enableDevelopmentFeatures() ======= } /** Should `git status` use --no-optional-locks to assist with concurrent usage */ export function enableStatusWithoutOptionalLocks(): boolean { return enableBetaFeatures() >>>>>>> } /** Should the app try and detect conflicts before the user stumbles into them? */ export function enableMergeConflictDetection(): boolean { return enableDevelopmentFeatures() } /** Should `git status` use --no-optional-locks to assist with concurrent usage */ export function enableStatusWithoutOptionalLocks(): boolean { return enableBetaFeatures()
<<<<<<< /** Merge the named branch into the current branch. */ public mergeBranch(repository: Repository, branch: string): Promise<void> { return this.appStore._mergeBranch(repository, branch) } ======= /** Record the given launch stats. */ public recordLaunchStats(stats: ILaunchStats): Promise<void> { return this.statsStore.recordLaunchStats(stats) } /** Report any stats if needed. */ public reportStats(): Promise<void> { return this.statsStore.reportStats() } >>>>>>> /** Merge the named branch into the current branch. */ public mergeBranch(repository: Repository, branch: string): Promise<void> { return this.appStore._mergeBranch(repository, branch) } /** Record the given launch stats. */ public recordLaunchStats(stats: ILaunchStats): Promise<void> { return this.statsStore.recordLaunchStats(stats) } /** Report any stats if needed. */ public reportStats(): Promise<void> { return this.statsStore.reportStats() }
<<<<<<< About, Acknowledgements, ======= About, PublishRepository, >>>>>>> About, PublishRepository, Acknowledgements, <<<<<<< { type: PopupType.About } | { type: PopupType.Acknowledgements } ======= { type: PopupType.About } | { type: PopupType.PublishRepository, repository: Repository } >>>>>>> { type: PopupType.About } | { type: PopupType.PublishRepository, repository: Repository } | { type: PopupType.Acknowledgements }
<<<<<<< } /** Should the app detect Windows Subsystem for Linux as a valid shell? */ export function enableWSLDetection(): boolean { return enableDevelopmentFeatures() ======= } /** * Should the application warn the user when they are about to commit to a * protected branch, and encourage them into a flow to move their changes to * a new branch? * * As this builds upon existing branch protection features in the codebase, this * flag is linked to to `enableBranchProtectionChecks()`. */ export function enableBranchProtectionWarningFlow(): boolean { return enableBranchProtectionChecks() && enableDevelopmentFeatures() >>>>>>> } /** Should the app detect Windows Subsystem for Linux as a valid shell? */ export function enableWSLDetection(): boolean { return enableDevelopmentFeatures() } /** * Should the application warn the user when they are about to commit to a * protected branch, and encourage them into a flow to move their changes to * a new branch? * * As this builds upon existing branch protection features in the codebase, this * flag is linked to to `enableBranchProtectionChecks()`. */ export function enableBranchProtectionWarningFlow(): boolean { return enableBranchProtectionChecks() && enableDevelopmentFeatures()
<<<<<<< this.updateOrSelectFirstCommit(repository, commits) return this.emitUpdate() } ======= this.updateCompareState(repository, () => ({ formState: { kind: ComparisonView.None, }, commitSHAs: commits, })) return this.emitUpdate() >>>>>>> this.updateOrSelectFirstCommit(repository, commits) this.updateCompareState(repository, () => ({ formState: { kind: ComparisonView.None, }, commitSHAs: commits, })) return this.emitUpdate() } <<<<<<< if ( branchesState.defaultBranch !== null && comparisonBranch.name === branchesState.defaultBranch.name ) { this.statsStore.recordDefaultBranchComparison() } ======= this.updateCompareState(repository, () => ({ formState: { comparisonBranch, kind: action.mode, aheadBehind, }, commitSHAs: compare.commits.map(commit => commit.sha), filterText: comparisonBranch.name, })) >>>>>>> if ( branchesState.defaultBranch !== null && comparisonBranch.name === branchesState.defaultBranch.name ) { this.statsStore.recordDefaultBranchComparison() }
<<<<<<< /** The number of times the users views a stash entry after checking out a branch */ readonly stashViewedAfterCheckoutCount: number /** The number of times the user elects to stash changes on the current branch */ readonly stashCreatedOnCurrentBranchCount: number /** The number of times the user elects to take changes to new branch instead of stashing them */ readonly changesTakenToNewBranchCount: number /** The number of times the user elects to restore an entry from their stash */ readonly stashRestoreCount: number /** The number of times the user elects to discard a stash entry */ readonly stashDiscardCount: number /** The number of times the user takes no action on a stash entry once viewed */ readonly noActionTakenOnStashCount: number ======= /** * The number of times the user has opened their external editor from the * suggested next steps view */ readonly suggestedStepOpenInExternalEditor: number /** * The number of times the user has opened their repository in Finder/Explorer * from the suggested next steps view */ readonly suggestedStepOpenWorkingDirectory: number /** * The number of times the user has opened their repository on GitHub from the * suggested next steps view */ readonly suggestedStepViewOnGitHub: number /** * The number of times the user has used the publish repository action from the * suggested next steps view */ readonly suggestedStepPublishRepository: number /** * The number of times the user has used the publish branch action branch from * the suggested next steps view */ readonly suggestedStepPublishBranch: number /** * The number of times the user has used the Create PR suggestion * in the suggested next steps view. Note that this number is a * subset of `createPullRequestCount`. I.e. if the Create PR suggestion * is invoked both `suggestedStepCreatePR` and `createPullRequestCount` * will increment whereas if a PR is created from the menu or from * a keyboard shortcut only `createPullRequestCount` will increment. */ readonly suggestedStepCreatePullRequest: number >>>>>>> /** The number of times the users views a stash entry after checking out a branch */ readonly stashViewedAfterCheckoutCount: number /** The number of times the user elects to stash changes on the current branch */ readonly stashCreatedOnCurrentBranchCount: number /** The number of times the user elects to take changes to new branch instead of stashing them */ readonly changesTakenToNewBranchCount: number /** The number of times the user elects to restore an entry from their stash */ readonly stashRestoreCount: number /** The number of times the user elects to discard a stash entry */ readonly stashDiscardCount: number /** The number of times the user takes no action on a stash entry once viewed */ readonly noActionTakenOnStashCount: number /** * The number of times the user has opened their external editor from the * suggested next steps view */ readonly suggestedStepOpenInExternalEditor: number /** * The number of times the user has opened their repository in Finder/Explorer * from the suggested next steps view */ readonly suggestedStepOpenWorkingDirectory: number /** * The number of times the user has opened their repository on GitHub from the * suggested next steps view */ readonly suggestedStepViewOnGitHub: number /** * The number of times the user has used the publish repository action from the * suggested next steps view */ readonly suggestedStepPublishRepository: number /** * The number of times the user has used the publish branch action branch from * the suggested next steps view */ readonly suggestedStepPublishBranch: number /** * The number of times the user has used the Create PR suggestion * in the suggested next steps view. Note that this number is a * subset of `createPullRequestCount`. I.e. if the Create PR suggestion * is invoked both `suggestedStepCreatePR` and `createPullRequestCount` * will increment whereas if a PR is created from the menu or from * a keyboard shortcut only `createPullRequestCount` will increment. */ readonly suggestedStepCreatePullRequest: number
<<<<<<< const byline = require('byline') ======= import { GitProcess, GitError, GitErrorCode } from 'git-kitchen-sink' >>>>>>> import { GitProcess, GitError, GitErrorCode } from 'git-kitchen-sink' const byline = require('byline') <<<<<<< return GitProcess.exec([ 'clone', '--progress', '--', url, path ], __dirname, undefined, process => { byline(process.stderr).on('data', (chunk: string) => { ======= return GitProcess.exec([ 'clone', '--recursive', '--progress', '--', url, path ], __dirname, undefined, process => { process.stderr.on('data', (chunk: string) => { >>>>>>> return GitProcess.exec([ 'clone', '--recursive', '--progress', '--', url, path ], __dirname, undefined, process => { byline(process.stderr).on('data', (chunk: string) => {
<<<<<<< public async _updatePullRequests(repository: Repository): Promise<void> { const gitHubRepository = repository.gitHubRepository if (!gitHubRepository) { return } const account = getAccountForEndpoint( this.accounts, gitHubRepository.endpoint ) if (!account) { return Promise.resolve() } const pullRequests = await this.pullRequestStore.updatePullRequests( gitHubRepository, account ) this.updatePullRequests(pullRequests, repository, gitHubRepository) } private updatePullRequests( pullRequests: ReadonlyArray<PullRequest>, repository: Repository, githubRepository: GitHubRepository ) { this.updateBranchesState(repository, state => { let currentPullRequest = null if (state.tip.kind === TipState.Valid) { currentPullRequest = this.findAssociatedPullRequest( state.tip.branch, pullRequests, githubRepository ) } return { ...state, pullRequests, currentPullRequest, } }) this.emitUpdate() } private findAssociatedPullRequest( branch: Branch, pullRequests: ReadonlyArray<PullRequest>, gitHubRepository: GitHubRepository ): PullRequest | null { const upstream = branch.upstreamWithoutRemote if (!upstream) { return null } for (const pr of pullRequests) { if ( pr.head.ref === upstream && // TODO: This doesn't work for when I've checked out a PR from a fork. pr.head.gitHubRepository.cloneURL === gitHubRepository.cloneURL ) { return pr } } return null } ======= public async _openCreatePullRequestInBrowser( repository: Repository ): Promise<void> { const gitHubRepository = repository.gitHubRepository if (!gitHubRepository) { return } const state = this.getRepositoryState(repository) const tip = state.branchesState.tip if (tip.kind !== TipState.Valid) { return } const branch = tip.branch const baseURL = `${gitHubRepository.htmlURL}/pull/new/${branch.nameWithoutRemote}` await this._openInBrowser(baseURL) } >>>>>>> public async _updatePullRequests(repository: Repository): Promise<void> { const gitHubRepository = repository.gitHubRepository if (!gitHubRepository) { return } const account = getAccountForEndpoint( this.accounts, gitHubRepository.endpoint ) if (!account) { return Promise.resolve() } const pullRequests = await this.pullRequestStore.updatePullRequests( gitHubRepository, account ) this.updatePullRequests(pullRequests, repository, gitHubRepository) } private updatePullRequests( pullRequests: ReadonlyArray<PullRequest>, repository: Repository, githubRepository: GitHubRepository ) { this.updateBranchesState(repository, state => { let currentPullRequest = null if (state.tip.kind === TipState.Valid) { currentPullRequest = this.findAssociatedPullRequest( state.tip.branch, pullRequests, githubRepository ) } return { ...state, pullRequests, currentPullRequest, } }) this.emitUpdate() } private findAssociatedPullRequest( branch: Branch, pullRequests: ReadonlyArray<PullRequest>, gitHubRepository: GitHubRepository ): PullRequest | null { const upstream = branch.upstreamWithoutRemote if (!upstream) { return null } for (const pr of pullRequests) { if ( pr.head.ref === upstream && // TODO: This doesn't work for when I've checked out a PR from a fork. pr.head.gitHubRepository.cloneURL === gitHubRepository.cloneURL ) { return pr } } return null } public async _openCreatePullRequestInBrowser( repository: Repository ): Promise<void> { const gitHubRepository = repository.gitHubRepository if (!gitHubRepository) { return } const state = this.getRepositoryState(repository) const tip = state.branchesState.tip if (tip.kind !== TipState.Valid) { return } const branch = tip.branch const baseURL = `${gitHubRepository.htmlURL}/pull/new/${branch.nameWithoutRemote}` await this._openInBrowser(baseURL) }
<<<<<<< public _clone(url: string, path: string, options: { user: User | null, branch?: string }): { promise: Promise<boolean>, repository: CloningRepository } { const promise = this.cloningRepositoriesStore.clone(url, path, options) const repository = this.cloningRepositoriesStore.repositories.find(r => r.url === url && r.path === path)! ======= public _clone(url: string, path: string, user: User | null): { promise: Promise<boolean>, repository: CloningRepository } { const promise = this.cloningRepositoriesStore.clone(url, path, user) const repository = this.cloningRepositoriesStore .repositories .find(r => r.url === url && r.path === path) ! >>>>>>> public _clone(url: string, path: string, options: { user: User | null, branch?: string }): { promise: Promise<boolean>, repository: CloningRepository } { const promise = this.cloningRepositoriesStore.clone(url, path, options) const repository = this.cloningRepositoriesStore .repositories .find(r => r.url === url && r.path === path) !
<<<<<<< /** Opens a terminal window with path as the working directory */ public openShell(path: string) { return this.appStore._openShell(path) } ======= /** Write the given rules to the gitignore file at the root of the repository. */ public setGitIgnoreText(repository: Repository, text: string): Promise<void> { return this.appStore._setGitIgnoreText(repository, text) } /** Populate the current root gitignore text into the application state */ public refreshGitIgnore(repository: Repository): Promise<void> { return this.appStore._refreshGitIgnore(repository) } /** Open the URL in a browser */ public openInBrowser(url: string) { return this.appStore._openInBrowser(url) } >>>>>>> /** Write the given rules to the gitignore file at the root of the repository. */ public setGitIgnoreText(repository: Repository, text: string): Promise<void> { return this.appStore._setGitIgnoreText(repository, text) } /** Populate the current root gitignore text into the application state */ public refreshGitIgnore(repository: Repository): Promise<void> { return this.appStore._refreshGitIgnore(repository) } /** Open the URL in a browser */ public openInBrowser(url: string) { return this.appStore._openInBrowser(url) } /** Opens a terminal window with path as the working directory */ public openShell(path: string) { return this.appStore._openShell(path) }
<<<<<<< Rider = 'JetBrains Rider', ======= NotepadPlusPlus = 'Notepad++', >>>>>>> NotepadPlusPlus = 'Notepad++', Rider = 'JetBrains Rider', <<<<<<< if (label === ExternalEditor.Rider) { return ExternalEditor.Rider } ======= if (label === ExternalEditor.NotepadPlusPlus) { return ExternalEditor.NotepadPlusPlus } >>>>>>> if (label === ExternalEditor.NotepadPlusPlus) { return ExternalEditor.NotepadPlusPlus } if (label === ExternalEditor.Rider) { return ExternalEditor.Rider } <<<<<<< case ExternalEditor.Rider: return [ // Rider 2019.3.4 { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\JetBrains Rider 2019.3.4', }, ] ======= case ExternalEditor.NotepadPlusPlus: return [ // 64-bit version of Notepad++ { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Notepad++', }, // 32-bit version of Notepad++ { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Notepad++', }, ] >>>>>>> case ExternalEditor.NotepadPlusPlus: return [ // 64-bit version of Notepad++ { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Notepad++', }, // 32-bit version of Notepad++ { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Notepad++', }, ] case ExternalEditor.Rider: return [ // Rider 2019.3.4 { key: HKEY.HKEY_LOCAL_MACHINE, subKey: 'SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\JetBrains Rider 2019.3.4', }, ] <<<<<<< case ExternalEditor.Rider: return Path.join(installLocation, 'bin', 'rider64.exe') ======= case ExternalEditor.NotepadPlusPlus: return Path.join(installLocation) >>>>>>> case ExternalEditor.NotepadPlusPlus: return Path.join(installLocation) case ExternalEditor.Rider: return Path.join(installLocation, 'bin', 'rider64.exe') <<<<<<< case ExternalEditor.Rider: return ( displayName.startsWith('JetBrains Rider') && publisher === 'JetBrains s.r.o.' ) ======= case ExternalEditor.NotepadPlusPlus: return ( displayName.startsWith('Notepad++') && publisher === 'Notepad++ Team' ) >>>>>>> case ExternalEditor.NotepadPlusPlus: return ( displayName.startsWith('Notepad++') && publisher === 'Notepad++ Team' ) case ExternalEditor.Rider: return ( displayName.startsWith('JetBrains Rider') && publisher === 'JetBrains s.r.o.' ) <<<<<<< if (editor === ExternalEditor.Rider) { let displayName = '' let publisher = '' let installLocation = '' for (const item of keys) { // NOTE: // Webstorm adds the current release number to the end of the Display Name, below checks for "PhpStorm" if ( item.name === 'DisplayName' && item.type === RegistryValueType.REG_SZ && item.data.startsWith('JetBrains Rider ') ) { displayName = 'JetBrains Rider' } else if ( item.name === 'Publisher' && item.type === RegistryValueType.REG_SZ ) { publisher = item.data } else if ( item.name === 'InstallLocation' && item.type === RegistryValueType.REG_SZ ) { installLocation = item.data } } return { displayName, publisher, installLocation } } ======= if (editor === ExternalEditor.NotepadPlusPlus) { const displayName = getKeyOrEmpty(keys, 'DisplayName') const publisher = getKeyOrEmpty(keys, 'Publisher') const installLocation = getKeyOrEmpty(keys, 'DisplayIcon') return { displayName, publisher, installLocation } } >>>>>>> if (editor === ExternalEditor.NotepadPlusPlus) { const displayName = getKeyOrEmpty(keys, 'DisplayName') const publisher = getKeyOrEmpty(keys, 'Publisher') const installLocation = getKeyOrEmpty(keys, 'DisplayIcon') return { displayName, publisher, installLocation } } if (editor === ExternalEditor.Rider) { let displayName = '' let publisher = '' let installLocation = '' for (const item of keys) { // NOTE: // Webstorm adds the current release number to the end of the Display Name, below checks for "PhpStorm" if ( item.name === 'DisplayName' && item.type === RegistryValueType.REG_SZ && item.data.startsWith('JetBrains Rider ') ) { displayName = 'JetBrains Rider' } else if ( item.name === 'Publisher' && item.type === RegistryValueType.REG_SZ ) { publisher = item.data } else if ( item.name === 'InstallLocation' && item.type === RegistryValueType.REG_SZ ) { installLocation = item.data } } return { displayName, publisher, installLocation } } <<<<<<< riderPath, ======= notepadPlusPlusPath, >>>>>>> notepadPlusPlusPath, riderPath, <<<<<<< findApplication(ExternalEditor.Rider), ======= findApplication(ExternalEditor.NotepadPlusPlus), >>>>>>> findApplication(ExternalEditor.NotepadPlusPlus), findApplication(ExternalEditor.Rider), <<<<<<< if (riderPath) { results.push({ editor: ExternalEditor.Rider, path: riderPath, }) } ======= if (notepadPlusPlusPath) { results.push({ editor: ExternalEditor.NotepadPlusPlus, path: notepadPlusPlusPath, }) } >>>>>>> if (notepadPlusPlusPath) { results.push({ editor: ExternalEditor.NotepadPlusPlus, path: notepadPlusPlusPath, }) } if (riderPath) { results.push({ editor: ExternalEditor.Rider, path: riderPath, }) }
<<<<<<< import { enableCompareSidebar, enableRepoInfoIndicators } from '../feature-flag' ======= import { enableCompareSidebar } from '../feature-flag' import { inferComparisonBranch } from './helpers/infer-comparison-branch' >>>>>>> import { enableCompareSidebar, enableRepoInfoIndicators } from '../feature-flag' import { inferComparisonBranch } from './helpers/infer-comparison-branch' <<<<<<< /** * Increments either the `repoWithIndicatorClicked` or * the `repoWithoutIndicatorClicked` metric */ public _recordRepoClicked(repoHasIndicator: boolean) { this.statsStore.recordRepoClicked(repoHasIndicator) } ======= /** * The number of times the user dismisses the diverged branch notification */ public _recordDivergingBranchBannerDismissal() { this.statsStore.recordDivergingBranchBannerDismissal() } /** * The number of times the user showne the diverged branch notification */ public _recordDivergingBranchBannerDisplayed() { this.statsStore.recordDivergingBranchBannerDisplayed() } >>>>>>> /** * Increments either the `repoWithIndicatorClicked` or * the `repoWithoutIndicatorClicked` metric */ public _recordRepoClicked(repoHasIndicator: boolean) { this.statsStore.recordRepoClicked(repoHasIndicator) } /** The number of times the user dismisses the diverged branch notification */ public _recordDivergingBranchBannerDismissal() { this.statsStore.recordDivergingBranchBannerDismissal() } /** * The number of times the user showne the diverged branch notification */ public _recordDivergingBranchBannerDisplayed() { this.statsStore.recordDivergingBranchBannerDisplayed() }
<<<<<<< return await ResponseHandler.generateAuthenticationResult( this.cryptoUtils, { account: cachedAccount, accessToken: cachedAccessToken, idToken: cachedIdToken, refreshToken: null }, idTokenObject, true); ======= return ResponseHandler.generateAuthenticationResult({ account: cachedAccount, accessToken: cachedAccessToken, idToken: cachedIdToken, refreshToken: null, appMetadata: null, }, idTokenObject, true); >>>>>>> return await ResponseHandler.generateAuthenticationResult( this.cryptoUtils, { account: cachedAccount, accessToken: cachedAccessToken, idToken: cachedIdToken, refreshToken: null, appMetadata: null, }, idTokenObject, true);
<<<<<<< import { IAPIOrganization, IAPIRefStatus, IAPIRepository, IAPIPullRequest, } from '../../lib/api' ======= import { IAPIOrganization, IAPIRepository } from '../../lib/api' >>>>>>> import { IAPIOrganization, IAPIRepository, IAPIPullRequest, } from '../../lib/api'
<<<<<<< import { TrustedAuthority } from "../authority/TrustedAuthority"; import { UnifiedCacheManager } from "../cache/UnifiedCacheManager"; import { AccountEntity } from "../cache/entities/AccountEntity"; import { IAccount } from "../account/IAccount"; import { AccountCache } from "../cache/utils/CacheTypes"; import { CacheHelper } from "../cache/utils/CacheHelper"; ======= import { B2cAuthority } from "../authority/B2cAuthority"; import { CacheManager } from "../cache/CacheManager"; >>>>>>> import { TrustedAuthority } from "../authority/TrustedAuthority"; import { CacheManager } from "../cache/CacheManager"; <<<<<<< TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.authOptions.knownAuthorities, this.config.authOptions.instanceMetadata); ======= B2cAuthority.setKnownAuthorities(this.config.authOptions.knownAuthorities); >>>>>>> TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.authOptions.knownAuthorities, this.config.authOptions.instanceMetadata);
<<<<<<< ipcMain.on('log', (event: Electron.IpcMessageEvent, logEntry: ILogEntry) => { log(logEntry) ======= ipcMain.on('log', (event: Electron.IpcMainEvent, level: LogLevel, message: string) => { writeLog(level, message) >>>>>>> ipcMain.on('log', (event: Electron.IpcMessageEvent, level: LogLevel, message: string) => { writeLog(level, message)
<<<<<<< import { assertNever } from '../fatal-error' ======= import { EmojiStore } from './emoji-store' import { GitStore, ICommitMessage } from './git-store' import { assertNever, forceUnwrap } from '../fatal-error' import { IssuesStore } from './issues-store' >>>>>>> import { assertNever, forceUnwrap } from '../fatal-error' <<<<<<< ======= import { PullRequestStore, ForkedRemotePrefix } from './pull-request-store' >>>>>>> <<<<<<< import { Disposable } from 'event-kit' ======= import { IRemote } from '../../models/remote' >>>>>>> import { Disposable } from 'event-kit' import { IRemote } from '../../models/remote' <<<<<<< export class AppStore extends BaseStore { ======= export class AppStore { private emitter = new Emitter() >>>>>>> export class AppStore extends BaseStore {
<<<<<<< public async recordSuggestedStepOpenInExternalEditor(): Promise<void> { this.statsStore.recordSuggestedStepOpenInExternalEditor() } public async recordSuggestedStepOpenWorkingDirectory(): Promise<void> { this.statsStore.recordSuggestedStepOpenWorkingDirectory() } public async recordSuggestedStepViewOnGitHub(): Promise<void> { this.statsStore.recordSuggestedStepViewOnGitHub() } public async recordSuggestedStepPublishRepository(): Promise<void> { this.statsStore.recordSuggestedStepPublishRepository() } public async recordSuggestedStepPublishBranch(): Promise<void> { this.statsStore.recordSuggestedStepPublishBranch() } public async recordSuggestedStepCreatePR(): Promise<void> { this.statsStore.recordSuggestedStepCreatePR() } ======= /** * Moves unconmitted changes to the branch being checked out */ public async moveChangesToBranchAndCheckout( repository: Repository, branchToCheckout: string ) { return this.appStore._moveChangesToBranchAndCheckout( repository, branchToCheckout ) } >>>>>>> public async recordSuggestedStepOpenInExternalEditor(): Promise<void> { this.statsStore.recordSuggestedStepOpenInExternalEditor() } public async recordSuggestedStepOpenWorkingDirectory(): Promise<void> { this.statsStore.recordSuggestedStepOpenWorkingDirectory() } public async recordSuggestedStepViewOnGitHub(): Promise<void> { this.statsStore.recordSuggestedStepViewOnGitHub() } public async recordSuggestedStepPublishRepository(): Promise<void> { this.statsStore.recordSuggestedStepPublishRepository() } public async recordSuggestedStepPublishBranch(): Promise<void> { this.statsStore.recordSuggestedStepPublishBranch() } public async recordSuggestedStepCreatePR(): Promise<void> { this.statsStore.recordSuggestedStepCreatePR() } /** * Moves unconmitted changes to the branch being checked out */ public async moveChangesToBranchAndCheckout( repository: Repository, branchToCheckout: string ) { return this.appStore._moveChangesToBranchAndCheckout( repository, branchToCheckout ) }
<<<<<<< import { installGlobalLFSFilters, isUsingLFS, installLFSHooks, } from '../git/lfs' ======= import { CloneRepositoryTab } from '../../models/clone-repository-tab' >>>>>>> import { installGlobalLFSFilters, isUsingLFS, installLFSHooks, } from '../git/lfs' import { CloneRepositoryTab } from '../../models/clone-repository-tab' <<<<<<< public async _installGlobalLFSFilters(): Promise<void> { try { await installGlobalLFSFilters() } catch (error) { this.emitError(error) } } private async isUsingLFS(repository: Repository): Promise<boolean> { try { return await isUsingLFS(repository) } catch (error) { return false } } public async _installLFSHooks( repositories: ReadonlyArray<Repository> ): Promise<void> { for (const repo of repositories) { try { await installLFSHooks(repo) } catch (error) { this.emitError(error) } } } ======= public _changeCloneRepositoriesTab(tab: CloneRepositoryTab): Promise<void> { this.selectedCloneRepositoryTab = tab this.emitUpdate() return Promise.resolve() } >>>>>>> public async _installGlobalLFSFilters(): Promise<void> { try { await installGlobalLFSFilters() } catch (error) { this.emitError(error) } } private async isUsingLFS(repository: Repository): Promise<boolean> { try { return await isUsingLFS(repository) } catch (error) { return false } } public async _installLFSHooks( repositories: ReadonlyArray<Repository> ): Promise<void> { for (const repo of repositories) { try { await installLFSHooks(repo) } catch (error) { this.emitError(error) } } } public _changeCloneRepositoriesTab(tab: CloneRepositoryTab): Promise<void> { this.selectedCloneRepositoryTab = tab this.emitUpdate() return Promise.resolve() }
<<<<<<< PublishBranch, PushBranchCommits, ======= CLIInstalled, >>>>>>> PushBranchCommits, CLIInstalled, <<<<<<< | { type: PopupType.PublishBranch repository: Repository branch: Branch } | { type: PopupType.PushBranchCommits repository: Repository branch: Branch unPushedCommits: number } ======= | { type: PopupType.CLIInstalled } >>>>>>> | { type: PopupType.PushBranchCommits repository: Repository branch: Branch unPushedCommits?: number } | { type: PopupType.CLIInstalled }
<<<<<<< ipcMain.on('proxy/request', (event: Electron.IpcMainEvent, { id, options }: { id: string, options: IHTTPRequest }) => { if (network === null) { // the network module can only be resolved after the app is ready network = require('electron').net if (network === null) { sharedProcess!.console.error('Electron net module not resolved, should never be in this state') return } } const channel = `proxy/response/${id}` const requestOptions = { url: options.url, headers: options.headers, method: options.method, } const request = network.request(requestOptions) request.on('response', (response: Electron.IncomingMessage) => { const responseBody: Array<number> = [ ] const encoding = getEncoding(response) response.on('abort', () => { event.sender.send(channel, { error: new Error('request aborted by the client') }) }) response.on('data', (chunk: Buffer) => { // rather than decode the bytes immediately, push them onto an array // and defer this until the entire response has been received chunk.forEach(v => responseBody.push(v)) }) response.on('end', () => { const statusCode = response.statusCode const headers = response.headers const contentType = getContentType(response) // central is currently serving a 204 with a string as JSON for usage stats // https://github.com/github/central/blob/master/app/controllers/api/usage.rb#L51 // once this has been fixed, simplify this check const validStatusCode = statusCode >= 200 && statusCode <= 299 && statusCode !== 204 const isJsonResponse = contentType === 'application/json' let body: Object | undefined if (responseBody.length > 0 && validStatusCode && isJsonResponse) { let text: string | undefined try { const buffer = Buffer.from(responseBody) text = buffer.toString(encoding) body = JSON.parse(text) } catch (e) { sharedProcess!.console.log(`JSON.parse failed for: '${text}'`) sharedProcess!.console.log(`Headers: '${JSON.stringify(response.headers)}'`) } } // emulating the rules from got for propagating errors // source: https://github.com/sindresorhus/got/blob/88a8ac8ac3d8ee2387983048368205c0bbe4abdf/index.js#L352-L357 let error: Error | undefined if (statusCode >= 400) { const statusMessage = http.STATUS_CODES[statusCode] error = new Error(`Response code ${statusCode} (${statusMessage})`) } const payload: IHTTPResponse = { statusCode, headers, body, error, } event.sender.send(channel, { response: payload }) }) }) request.on('abort', () => { event.sender.send(channel, { error: new Error('request aborted by the client') }) }) request.on('aborted', () => { event.sender.send(channel, { error: new Error('request aborted by the server') }) }) const body = options.body ? JSON.stringify(options.body) : undefined request.end(body) }) ======= /** * An event sent by the renderer asking for a copy of the current * application menu. */ ipcMain.on('get-app-menu', () => { if (mainWindow) { mainWindow.sendAppMenu() } }) >>>>>>> ipcMain.on('proxy/request', (event: Electron.IpcMainEvent, { id, options }: { id: string, options: IHTTPRequest }) => { if (network === null) { // the network module can only be resolved after the app is ready network = require('electron').net if (network === null) { sharedProcess!.console.error('Electron net module not resolved, should never be in this state') return } } const channel = `proxy/response/${id}` const requestOptions = { url: options.url, headers: options.headers, method: options.method, } const request = network.request(requestOptions) request.on('response', (response: Electron.IncomingMessage) => { const responseBody: Array<number> = [ ] const encoding = getEncoding(response) response.on('abort', () => { event.sender.send(channel, { error: new Error('request aborted by the client') }) }) response.on('data', (chunk: Buffer) => { // rather than decode the bytes immediately, push them onto an array // and defer this until the entire response has been received chunk.forEach(v => responseBody.push(v)) }) response.on('end', () => { const statusCode = response.statusCode const headers = response.headers const contentType = getContentType(response) // central is currently serving a 204 with a string as JSON for usage stats // https://github.com/github/central/blob/master/app/controllers/api/usage.rb#L51 // once this has been fixed, simplify this check const validStatusCode = statusCode >= 200 && statusCode <= 299 && statusCode !== 204 const isJsonResponse = contentType === 'application/json' let body: Object | undefined if (responseBody.length > 0 && validStatusCode && isJsonResponse) { let text: string | undefined try { const buffer = Buffer.from(responseBody) text = buffer.toString(encoding) body = JSON.parse(text) } catch (e) { sharedProcess!.console.log(`JSON.parse failed for: '${text}'`) sharedProcess!.console.log(`Headers: '${JSON.stringify(response.headers)}'`) } } // emulating the rules from got for propagating errors // source: https://github.com/sindresorhus/got/blob/88a8ac8ac3d8ee2387983048368205c0bbe4abdf/index.js#L352-L357 let error: Error | undefined if (statusCode >= 400) { const statusMessage = http.STATUS_CODES[statusCode] error = new Error(`Response code ${statusCode} (${statusMessage})`) } const payload: IHTTPResponse = { statusCode, headers, body, error, } event.sender.send(channel, { response: payload }) }) }) request.on('abort', () => { event.sender.send(channel, { error: new Error('request aborted by the client') }) }) request.on('aborted', () => { event.sender.send(channel, { error: new Error('request aborted by the server') }) }) const body = options.body ? JSON.stringify(options.body) : undefined request.end(body) }) /** * An event sent by the renderer asking for a copy of the current * application menu. */ ipcMain.on('get-app-menu', () => { if (mainWindow) { mainWindow.sendAppMenu() } })
<<<<<<< /** Fetch the repository. */ public fetch(repository: Repository): Promise<void> { return this.appStore.fetch(repository) } ======= /** * Set the commit summary and description for a work-in-progress * commit in the changes view for a particular repository. */ public setCommitMessage(repository: Repository, message: ICommitMessage | null): Promise<void> { return this.appStore._setCommitMessage(repository, message) } >>>>>>> /** Fetch the repository. */ public fetch(repository: Repository): Promise<void> { return this.appStore.fetch(repository) } /** * Set the commit summary and description for a work-in-progress * commit in the changes view for a particular repository. */ public setCommitMessage(repository: Repository, message: ICommitMessage | null): Promise<void> { return this.appStore._setCommitMessage(repository, message) }
<<<<<<< InstallGit, About ======= About, PublishRepository, >>>>>>> About, InstallGit, PublishRepository, <<<<<<< { type: PopupType.About } | { type: PopupType.InstallGit, path: string } ======= { type: PopupType.About } | { type: PopupType.PublishRepository, repository: Repository } >>>>>>> { type: PopupType.About } | { type: PopupType.InstallGit, path: string } | { type: PopupType.PublishRepository, repository: Repository }
<<<<<<< import * as URL from 'url' import {app, ipcMain} from 'electron' ======= import {app, Menu} from 'electron' >>>>>>> import * as URL from 'url' import {app, ipcMain, Menu} from 'electron' <<<<<<< import {requestToken, authenticate, setToken} from './auth' ======= import {buildDefaultMenu} from './menu' >>>>>>> import {requestToken, authenticate, setToken} from './auth' import {buildDefaultMenu} from './menu' <<<<<<< type URLAction = 'oauth' | 'unknown' app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit() } }) app.on('will-finish-launching', () => { app.on('open-url', (event, url) => { const parsedURL = URL.parse(url, true) const action = parseURLAction(parsedURL) if (action === 'oauth') { requestToken(parsedURL.query.code).then(token => { setToken(token) mainWindow.didAuthenticate() }) } else { console.error(`I dunno how to handle this URL: ${url}`) } event.preventDefault() }) }) app.on('ready', () => { stats.readyTime = Date.now() app.setAsDefaultProtocolClient('x-github-client') ipcMain.on('request-auth', authenticate) ======= function createWindow() { >>>>>>> type URLAction = 'oauth' | 'unknown' app.on('will-finish-launching', () => { app.on('open-url', (event, url) => { const parsedURL = URL.parse(url, true) const action = parseURLAction(parsedURL) if (action === 'oauth') { requestToken(parsedURL.query.code).then(token => { setToken(token) mainWindow.didAuthenticate() }) } else { console.error(`I dunno how to handle this URL: ${url}`) } event.preventDefault() }) }) app.on('ready', () => { stats.readyTime = Date.now() app.setAsDefaultProtocolClient('x-github-client') ipcMain.on('request-auth', authenticate) createWindow() Menu.setApplicationMenu(buildDefaultMenu()) }) app.on('activate', () => { if (!mainWindow) { createWindow() } }) app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit() } }) function createWindow() { <<<<<<< }) function parseURLAction(parsedURL: URL.Url): URLAction { const actionName = parsedURL.hostname if (actionName === 'oauth') { return 'oauth' } else { return 'unknown' } } ======= } app.on('ready', () => { stats.readyTime = Date.now() createWindow() Menu.setApplicationMenu(buildDefaultMenu()) }) app.on('window-all-closed', () => { if (process.platform !== 'darwin') { app.quit() } }) app.on('activate', () => { if (!mainWindow) { createWindow() } }) >>>>>>> } function parseURLAction(parsedURL: URL.Url): URLAction { const actionName = parsedURL.hostname if (actionName === 'oauth') { return 'oauth' } else { return 'unknown' } }
<<<<<<< import { RepositoryIndicatorUpdater } from './helpers/repository-indicator-updater' ======= import { getAttributableEmailsFor } from '../email' >>>>>>> import { RepositoryIndicatorUpdater } from './helpers/repository-indicator-updater' import { getAttributableEmailsFor } from '../email' <<<<<<< /** * Wait 2 minutes before refreshing repository indicators */ const InitialRepositoryIndicatorTimeout = 2 * 60 * 1000 ======= const MaxInvalidFoldersToDisplay = 3 >>>>>>> /** * Wait 2 minutes before refreshing repository indicators */ const InitialRepositoryIndicatorTimeout = 2 * 60 * 1000 const MaxInvalidFoldersToDisplay = 3