Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly duplicate files with numbers in filename #22907

Conversation

imwiss
Copy link
Contributor

@imwiss imwiss commented Mar 20, 2017

This PR fixes an issue with duplicating files with numbers in the filename. It now correctly duplicates files with numbers in filename by appending a version instead of incrementing the integer.

Before:
Duplication of "1.js" gives "2.js".

Now:
Duplication of "1.js" gives "1.1.js"

Original issue: #22876

@mention-bot
Copy link

@wabirached, thanks for your PR! By analyzing the history of the files in this pull request, we identified @bpasero and @egamma to be potential reviewers.

@msftclas
Copy link

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request.
Thanks,
Microsoft Pull Request Bot

@bpasero
Copy link
Member

bpasero commented Mar 20, 2017

@wabirached a filename called test.35.txt still ends up as test.36.txt when I copy it, can we improve it for that case as well?

@imwiss
Copy link
Contributor Author

imwiss commented Mar 20, 2017

hey @bpasero, I thought that was the intended behaviour based on this comment: https://github.com/Microsoft/vscode/pull/22907/files#diff-9404b1da682862c61dce10b84ff76e5cR1101

This makes sense if a user is duplicating the file multiple times (test.txt -> test.1.txt -> test.2.txt -> etc).

It's also the way it worked in previous builds (and it's consistent with how other products behave). Let me know what you think.

@bpasero
Copy link
Member

bpasero commented Mar 20, 2017

@wabirached of course, good point, I oversaw this.

@bpasero bpasero merged commit c484d0c into microsoft:master Mar 20, 2017
@bpasero bpasero added this to the March 2017 milestone Mar 20, 2017
@imwiss imwiss deleted the hotfix/correctly-duplicate-files-with-numbers-in-filename branch April 7, 2017 15:55
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants