-
Notifications
You must be signed in to change notification settings - Fork 255
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
Don't add file if plugin sets content to None
#321
Conversation
I like the idea, but I would like to see a test case where a file is removed using the plugin. The test case should also check that nothing bad happens when a plugin-deleted file is removed in a later mercurial commit. |
Added a test that adds, modifies and removes a file in the hg repository and uses a plugin to remove that file when converting to git. The resulting git repository then doesn't contain any references to the "bad" files. There are some empty commits in the resulting repository, because all the changes done in those commits were to "bad" files. This has no negative consequences despite maybe looking a bit odd at first sight. But it makes sense since all the changes in those commits were to files that got removed. |
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.
LGTM apart from the copyright year...
Please squash the fix into the commit for the test case. Unless you protest, I can do that when I get time to start merging later today. |
39b4eb3
to
ddb5740
Compare
I squashed it. |
Thank you for your contribution @sth. |
I was looking for a way to filter the files that get included in the new repository. Currently a plugin can modify the content, but not completely remove it.
A straight forward way for a plugin to show it doesn't want the file is to set
file_data['data']
toNone
. In the main script this can also easily be handled: Only output the file if its data is notNone
.The change is quite minimal and shouldn't interfere with any existing code.