Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,6 @@
"category": "DVC",
"icon": "$(discard)"
},
{
"title": "Rename",
"command": "dvc.renameTarget",
"category": "DVC"
},
{
"title": "Run Experiment",
"command": "dvc.runExperiment",
Expand Down Expand Up @@ -831,10 +826,6 @@
"command": "dvc.removeTarget",
"when": "false"
},
{
"command": "dvc.renameTarget",
"when": "false"
},
{
"command": "dvc.discardWorkspaceChanges",
"when": "dvc.commands.available && dvc.project.available && !dvc.scm.command.running"
Expand Down Expand Up @@ -1170,11 +1161,6 @@
"group": "6_copypath@2",
"when": "view == dvc.views.trackedExplorerTree"
},
{
"command": "dvc.renameTarget",
"group": "7_modification@1",
"when": "view == dvc.views.trackedExplorerTree && viewItem =~ /^.*Data$/"
},
{
"command": "dvc.deleteTarget",
"group": "7_modification@2",
Expand Down
24 changes: 0 additions & 24 deletions extension/src/cli/dvc/executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,30 +402,6 @@ describe('CliExecutor', () => {
})
})

describe('move', () => {
it('should call createProcess with the correct parameters to move a DVC tracked target', async () => {
const cwd = __dirname
const target = 'data/data.xml.dvc'
const destination = 'data/data1.xml.dvc'
const stdout = `
To track the changes with git, run:

git add ${destination} data/.gitignore`

mockedCreateProcess.mockReturnValueOnce(getMockedProcess(stdout))

const output = await dvcExecutor.move(cwd, target, destination)
expect(output).toStrictEqual(stdout)

expect(mockedCreateProcess).toHaveBeenCalledWith({
args: ['move', target, destination],
cwd,
env: mockedEnv,
executable: 'dvc'
})
})
})

describe('pull', () => {
it('should call createProcess with the correct parameters to pull the entire repository', async () => {
const cwd = __dirname
Expand Down
5 changes: 0 additions & 5 deletions extension/src/cli/dvc/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const autoRegisteredCommands = {
EXP_RENAME: 'expRename',
INIT: 'init',
IS_SCM_COMMAND_RUNNING: 'isScmCommandRunning',
MOVE: 'move',
PULL: 'pull',
PUSH: 'push',
QUEUE_KILL: 'queueKill',
Expand Down Expand Up @@ -121,10 +120,6 @@ export class DvcExecutor extends DvcCli {
)
}

public move(cwd: string, target: string, destination: string) {
return this.blockAndExecuteProcess(cwd, Command.MOVE, target, destination)
}

public pull(cwd: string, ...args: Args) {
return this.blockAndExecuteProcess(cwd, Command.PULL, ...args)
}
Expand Down
1 change: 0 additions & 1 deletion extension/src/commands/external.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export enum RegisteredCliCommands {
PUSH = 'dvc.push',
PUSH_TARGET = 'dvc.pushTarget',
REMOVE_TARGET = 'dvc.removeTarget',
RENAME_TARGET = 'dvc.renameTarget',

REMOTE_ADD = 'dvc.addRemote',
REMOTE_MODIFY = 'dvc.modifyRemote',
Expand Down
24 changes: 1 addition & 23 deletions extension/src/repository/model/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { collectSelected, collectTrackedPaths, PathItem } from './collect'
import { Resource } from '../commands'
import { WorkspaceRepositories } from '../workspace'
import { exists, relativeWithUri } from '../../fileSystem'
import { exists } from '../../fileSystem'
import { standardizePath } from '../../fileSystem/path'
import { fireWatcher } from '../../fileSystem/watcher'
import { deleteTarget, moveTargets } from '../../fileSystem/workspace'
Expand All @@ -32,7 +32,6 @@ import {
} from '../../commands/external'
import { sendViewOpenedTelemetryEvent } from '../../telemetry'
import { EventName } from '../../telemetry/constants'
import { getInput } from '../../vscode/inputBox'
import { pickResources } from '../../vscode/resourcePicker'
import { Modal } from '../../vscode/modal'
import { Response } from '../../vscode/response'
Expand Down Expand Up @@ -244,27 +243,6 @@ export class RepositoriesTree
}
)

this.internalCommands.registerExternalCliCommand<Resource>(
RegisteredCliCommands.RENAME_TARGET,
async ({ dvcRoot, resourceUri }) => {
const relPath = relativeWithUri(dvcRoot, resourceUri)
const relDestination = await getInput(
Title.ENTER_RELATIVE_DESTINATION,
relPath
)
if (!relDestination || relDestination === relPath) {
return
}

return this.internalCommands.executeCommand(
AvailableCommands.MOVE,
dvcRoot,
relPath,
relDestination
)
}
)

this.internalCommands.registerExternalCliCommand<PathItem>(
RegisteredCliCommands.PULL_TARGET,
this.tryThenForce(AvailableCommands.PULL)
Expand Down
1 change: 0 additions & 1 deletion extension/src/telemetry/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export interface IEventNamePropertyMapping {
[EventName.PUSH_TARGET]: undefined
[EventName.PUSH]: undefined
[EventName.REMOVE_TARGET]: undefined
[EventName.RENAME_TARGET]: undefined

[EventName.REMOTE_ADD]: undefined
[EventName.REMOTE_MODIFY]: undefined
Expand Down
26 changes: 0 additions & 26 deletions extension/src/test/suite/repository/model/tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
RegisteredCommands
} from '../../../../commands/external'
import { WEBVIEW_TEST_TIMEOUT } from '../../timeouts'
import { Title } from '../../../../vscode/title'
import { Repository } from '../../../../repository'
import { WorkspaceRepositories } from '../../../../repository/workspace'
import { RepositoriesTree } from '../../../../repository/model/tree'
Expand Down Expand Up @@ -259,31 +258,6 @@ suite('Repositories Tree Test Suite', () => {
expect(mockRemove).to.be.calledOnce
})

it('should be able to run dvc.renameTarget without error', async () => {
const relPath = join('mock', 'data', 'MNIST', 'raw')
stub(path, 'relative').returns(relPath)

const mockMove = stub(DvcExecutor.prototype, 'move').resolves(
'target moved to new destination'
)

const mockInputBox = stub(window, 'showInputBox').resolves(
relPath + 'est'
)

await commands.executeCommand(
RegisteredCliCommands.RENAME_TARGET,
getPathItem(relPath)
)
expect(mockMove).to.be.calledOnce
expect(mockInputBox).to.be.calledOnce
expect(mockInputBox).to.be.calledWith({
prompt: undefined,
title: Title.ENTER_RELATIVE_DESTINATION,
value: relPath
})
})

it('should pull the correct target(s) when asked to dvc.pullTarget a non-tracked directory', async () => {
const { gitReader, internalCommands, mockDataStatus } = buildDependencies(
{ disposer: disposable }
Expand Down
1 change: 0 additions & 1 deletion extension/src/vscode/title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export enum Title {
ENTER_COMMIT_MESSAGE = 'Enter a Commit Message',
ENTER_EXPERIMENT_WORKER_COUNT = 'Enter the Number of Queue Workers',
ENTER_FILTER_VALUE = 'Enter a Filter Value',
ENTER_RELATIVE_DESTINATION = 'Enter a Destination Relative to the Root',
ENTER_REMOTE_NAME = 'Enter a Name for the Remote',
ENTER_REMOTE_URL = 'Enter the URL for the Remote',
ENTER_PATH_OR_CHOOSE_FILE = 'Enter the path to your training script or select it',
Expand Down