@@ -9,12 +9,13 @@ import {
99 SourceControlResourceGroup
1010} from "vscode" ;
1111import { inputCommitMessage } from "./messages" ;
12- import { Svn } from "./svn" ;
12+ import { Svn , Status } from "./svn" ;
1313import { Model } from "./model" ;
1414import { Repository } from "./repository" ;
1515import { Resource } from "./resource" ;
1616import { toSvnUri } from "./uri" ;
1717import * as path from "path" ;
18+ import { start } from "repl" ;
1819
1920interface CommandOptions {
2021 repository ?: boolean ;
@@ -200,6 +201,15 @@ export class SvnCommands {
200201 return state . resourceUri . fsPath ;
201202 } ) ;
202203
204+ //If files is renamed, the commit need previous file
205+ choice . resourceGroup . resourceStates . forEach ( state => {
206+ if ( state instanceof Resource ) {
207+ if ( state . type === Status . ADDED && state . renameResourceUri ) {
208+ filePaths . push ( state . renameResourceUri . fsPath ) ;
209+ }
210+ }
211+ } ) ;
212+
203213 try {
204214 const result = await repository . repository . commitFiles (
205215 message ,
@@ -311,6 +321,14 @@ export class SvnCommands {
311321 const paths = resourceStates . map ( state => {
312322 return state . resourceUri . fsPath ;
313323 } ) ;
324+
325+ //If files is renamed, the commit need previous file
326+ resourceStates . forEach ( state => {
327+ if ( state . type === Status . ADDED && state . renameResourceUri ) {
328+ paths . push ( state . renameResourceUri . fsPath ) ;
329+ }
330+ } ) ;
331+
314332 const message = await inputCommitMessage ( ) ;
315333
316334 if ( message === undefined ) {
0 commit comments