-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Better auto-renaming #709
Better auto-renaming #709
Conversation
Thank you for PR. |
@@ -39,6 +39,35 @@ void RequestGroupTest::testGetFirstFilePath() | |||
|
|||
CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile"), group.getFirstFilePath()); | |||
|
|||
// test file renaming |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, these tests should go their own function, say, testTryAutoFileRenaming().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no problem
I considered if it would break some code, but really, I saw the likelihood of that to be so small that I don't think we should address this. Either way, the benefits outweigh the potential drawback by this wide a margin, that this new behavior should be the default. |
This should do the trick then, @tatsuhiro-t |
@@ -39,11 +41,65 @@ void RequestGroupTest::testGetFirstFilePath() | |||
|
|||
CPPUNIT_ASSERT_EQUAL(std::string("/tmp/myfile"), group.getFirstFilePath()); | |||
|
|||
// test in-memory | |||
ctx->getFirstFileEntry()->setPath("/tmp/myfile"); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, this is accidental left over?
Fair enough. Let's do this and let's see the response from users. |
ok, I'll address the minor thing you mentioned, squash it together with a more descriptive log message (for the changelog) and push it once I get home |
having things like "image.jpg.1" when autorenaming happens is only marginally helpful... It is better to rename it to "image.1.jpg" instead, which is what this PR does.
If a file has no extension, it will still become just "file.1".
Added tests for this too, which required making
tryAutoFileRenaming
public (short of nasty "only make this public in tests" hacks)