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

Add reference linking as an option for the post processor. #3633

Merged
merged 6 commits into from
Mar 7, 2018
Merged

Add reference linking as an option for the post processor. #3633

merged 6 commits into from
Mar 7, 2018

Conversation

Kriskras99
Copy link
Contributor

  • PR is based on the DEVELOP branch
  • Don't send big changes all at once. Split up big PRs into multiple smaller PRs that are easier to manage and review
  • Read the contribution guide

See #3394
This is a new pull request because I messed up my previous git repository.

This adds reflink support for CoW filesystems, currently only BTRFS, upstream is working on adding support for Apple's APFS and I'm looking into Windows' ReFS.

@codecov-io
Copy link

codecov-io commented Jan 19, 2018

Codecov Report

Merging #3633 into develop will decrease coverage by <.01%.
The diff coverage is 20.83%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3633      +/-   ##
===========================================
- Coverage    29.36%   29.35%   -0.01%     
===========================================
  Files          274      274              
  Lines        35395    35419      +24     
===========================================
+ Hits         10393    10398       +5     
- Misses       25002    25021      +19
Impacted Files Coverage Δ
medusa/helpers/__init__.py 21.97% <20.83%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 23a27c2...c21f3a2. Read the comment docs.

@p0psicles
Copy link
Contributor

@medariox can you take a look at this? is it ready?

Copy link
Contributor

@medariox medariox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor things left to do and it can be merged IMO. Thanks!

try:
if reflink is None:
raise NotImplementedError()
reflink.reflink(src_file.encode('utf-8'), dest_file.encode('utf-8'))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the encoding of src_file and dest_file really needed here? I've noticed that the reflink package supports Python 3 as well, so Unicode paths shouldn't be an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because otherwise reflink will encode any string as ascii, which will fail on some foreign shows.
See this pull request (which I just opened because I forgot about this).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you mean. In this case, can you please add a comment referencing the issue?

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

% for cur_action in ('copy', 'move', 'hardlink', 'symlink'):
<option value="${cur_action}" ${'selected="selected"' if app.PROCESS_METHOD == cur_action else ''}>${process_method_text[cur_action]}</option>
% endfor
% if pkgutil.find_loader("reflink") is not None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes here.

@medariox medariox merged commit 729945d into pymedusa:develop Mar 7, 2018
@medariox
Copy link
Contributor

medariox commented Mar 7, 2018

Thanks for the great addition!

@Kriskras99
Copy link
Contributor Author

No problem, I'm happy it's merged!

medariox pushed a commit that referenced this pull request Jul 11, 2018
* Fix reference linking
Pull request #3633 (#3633) only included half of the files.

* Remove spaces from blank line

* Make if-statement safer

* Make if-statement more pythonic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants