Skip to content

Commit 6c9ad0b

Browse files
committed
Remove the rename command from the DVC tracked tree
1 parent 737584a commit 6c9ad0b

File tree

8 files changed

+1
-95
lines changed

8 files changed

+1
-95
lines changed

extension/package.json

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,6 @@
335335
"category": "DVC",
336336
"icon": "$(discard)"
337337
},
338-
{
339-
"title": "Rename",
340-
"command": "dvc.renameTarget",
341-
"category": "DVC"
342-
},
343338
{
344339
"title": "Run Experiment",
345340
"command": "dvc.runExperiment",
@@ -831,10 +826,6 @@
831826
"command": "dvc.removeTarget",
832827
"when": "false"
833828
},
834-
{
835-
"command": "dvc.renameTarget",
836-
"when": "false"
837-
},
838829
{
839830
"command": "dvc.discardWorkspaceChanges",
840831
"when": "dvc.commands.available && dvc.project.available && !dvc.scm.command.running"
@@ -1170,11 +1161,6 @@
11701161
"group": "6_copypath@2",
11711162
"when": "view == dvc.views.trackedExplorerTree"
11721163
},
1173-
{
1174-
"command": "dvc.renameTarget",
1175-
"group": "7_modification@1",
1176-
"when": "view == dvc.views.trackedExplorerTree && viewItem =~ /^.*Data$/"
1177-
},
11781164
{
11791165
"command": "dvc.deleteTarget",
11801166
"group": "7_modification@2",

extension/src/cli/dvc/executor.test.ts

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -402,30 +402,6 @@ describe('CliExecutor', () => {
402402
})
403403
})
404404

405-
describe('move', () => {
406-
it('should call createProcess with the correct parameters to move a DVC tracked target', async () => {
407-
const cwd = __dirname
408-
const target = 'data/data.xml.dvc'
409-
const destination = 'data/data1.xml.dvc'
410-
const stdout = `
411-
To track the changes with git, run:
412-
413-
git add ${destination} data/.gitignore`
414-
415-
mockedCreateProcess.mockReturnValueOnce(getMockedProcess(stdout))
416-
417-
const output = await dvcExecutor.move(cwd, target, destination)
418-
expect(output).toStrictEqual(stdout)
419-
420-
expect(mockedCreateProcess).toHaveBeenCalledWith({
421-
args: ['move', target, destination],
422-
cwd,
423-
env: mockedEnv,
424-
executable: 'dvc'
425-
})
426-
})
427-
})
428-
429405
describe('pull', () => {
430406
it('should call createProcess with the correct parameters to pull the entire repository', async () => {
431407
const cwd = __dirname

extension/src/cli/dvc/executor.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const autoRegisteredCommands = {
2424
EXP_RENAME: 'expRename',
2525
INIT: 'init',
2626
IS_SCM_COMMAND_RUNNING: 'isScmCommandRunning',
27-
MOVE: 'move',
2827
PULL: 'pull',
2928
PUSH: 'push',
3029
QUEUE_KILL: 'queueKill',
@@ -121,10 +120,6 @@ export class DvcExecutor extends DvcCli {
121120
)
122121
}
123122

124-
public move(cwd: string, target: string, destination: string) {
125-
return this.blockAndExecuteProcess(cwd, Command.MOVE, target, destination)
126-
}
127-
128123
public pull(cwd: string, ...args: Args) {
129124
return this.blockAndExecuteProcess(cwd, Command.PULL, ...args)
130125
}

extension/src/commands/external.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export enum RegisteredCliCommands {
3434
PUSH = 'dvc.push',
3535
PUSH_TARGET = 'dvc.pushTarget',
3636
REMOVE_TARGET = 'dvc.removeTarget',
37-
RENAME_TARGET = 'dvc.renameTarget',
3837

3938
REMOTE_ADD = 'dvc.addRemote',
4039
REMOTE_MODIFY = 'dvc.modifyRemote',

extension/src/repository/model/tree.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
import { collectSelected, collectTrackedPaths, PathItem } from './collect'
1212
import { Resource } from '../commands'
1313
import { WorkspaceRepositories } from '../workspace'
14-
import { exists, relativeWithUri } from '../../fileSystem'
14+
import { exists } from '../../fileSystem'
1515
import { standardizePath } from '../../fileSystem/path'
1616
import { fireWatcher } from '../../fileSystem/watcher'
1717
import { deleteTarget, moveTargets } from '../../fileSystem/workspace'
@@ -32,7 +32,6 @@ import {
3232
} from '../../commands/external'
3333
import { sendViewOpenedTelemetryEvent } from '../../telemetry'
3434
import { EventName } from '../../telemetry/constants'
35-
import { getInput } from '../../vscode/inputBox'
3635
import { pickResources } from '../../vscode/resourcePicker'
3736
import { Modal } from '../../vscode/modal'
3837
import { Response } from '../../vscode/response'
@@ -244,27 +243,6 @@ export class RepositoriesTree
244243
}
245244
)
246245

247-
this.internalCommands.registerExternalCliCommand<Resource>(
248-
RegisteredCliCommands.RENAME_TARGET,
249-
async ({ dvcRoot, resourceUri }) => {
250-
const relPath = relativeWithUri(dvcRoot, resourceUri)
251-
const relDestination = await getInput(
252-
Title.ENTER_RELATIVE_DESTINATION,
253-
relPath
254-
)
255-
if (!relDestination || relDestination === relPath) {
256-
return
257-
}
258-
259-
return this.internalCommands.executeCommand(
260-
AvailableCommands.MOVE,
261-
dvcRoot,
262-
relPath,
263-
relDestination
264-
)
265-
}
266-
)
267-
268246
this.internalCommands.registerExternalCliCommand<PathItem>(
269247
RegisteredCliCommands.PULL_TARGET,
270248
this.tryThenForce(AvailableCommands.PULL)

extension/src/telemetry/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ export interface IEventNamePropertyMapping {
215215
[EventName.PUSH_TARGET]: undefined
216216
[EventName.PUSH]: undefined
217217
[EventName.REMOVE_TARGET]: undefined
218-
[EventName.RENAME_TARGET]: undefined
219218

220219
[EventName.REMOTE_ADD]: undefined
221220
[EventName.REMOTE_MODIFY]: undefined

extension/src/test/suite/repository/model/tree.test.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import {
2929
RegisteredCommands
3030
} from '../../../../commands/external'
3131
import { WEBVIEW_TEST_TIMEOUT } from '../../timeouts'
32-
import { Title } from '../../../../vscode/title'
3332
import { Repository } from '../../../../repository'
3433
import { WorkspaceRepositories } from '../../../../repository/workspace'
3534
import { RepositoriesTree } from '../../../../repository/model/tree'
@@ -259,31 +258,6 @@ suite('Repositories Tree Test Suite', () => {
259258
expect(mockRemove).to.be.calledOnce
260259
})
261260

262-
it('should be able to run dvc.renameTarget without error', async () => {
263-
const relPath = join('mock', 'data', 'MNIST', 'raw')
264-
stub(path, 'relative').returns(relPath)
265-
266-
const mockMove = stub(DvcExecutor.prototype, 'move').resolves(
267-
'target moved to new destination'
268-
)
269-
270-
const mockInputBox = stub(window, 'showInputBox').resolves(
271-
relPath + 'est'
272-
)
273-
274-
await commands.executeCommand(
275-
RegisteredCliCommands.RENAME_TARGET,
276-
getPathItem(relPath)
277-
)
278-
expect(mockMove).to.be.calledOnce
279-
expect(mockInputBox).to.be.calledOnce
280-
expect(mockInputBox).to.be.calledWith({
281-
prompt: undefined,
282-
title: Title.ENTER_RELATIVE_DESTINATION,
283-
value: relPath
284-
})
285-
})
286-
287261
it('should pull the correct target(s) when asked to dvc.pullTarget a non-tracked directory', async () => {
288262
const { gitReader, internalCommands, mockDataStatus } = buildDependencies(
289263
{ disposer: disposable }

extension/src/vscode/title.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export enum Title {
66
ENTER_COMMIT_MESSAGE = 'Enter a Commit Message',
77
ENTER_EXPERIMENT_WORKER_COUNT = 'Enter the Number of Queue Workers',
88
ENTER_FILTER_VALUE = 'Enter a Filter Value',
9-
ENTER_RELATIVE_DESTINATION = 'Enter a Destination Relative to the Root',
109
ENTER_REMOTE_NAME = 'Enter a Name for the Remote',
1110
ENTER_REMOTE_URL = 'Enter the URL for the Remote',
1211
ENTER_PATH_OR_CHOOSE_FILE = 'Enter the path to your training script or select it',

0 commit comments

Comments
 (0)