Support file renames in before/after
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start with parsepatch issue #6, then inspect the build_lines_hash logic and how revisions provide paths for before and after modes. Done means renamed files resolve from both paths, unchanged files return the same path twice, and a missing path raises an exception as described in the examples.
Written by the indexing model from the issue text.
Description
We must support the file renames in a patch. First, parsepatch has to support them, then we need to change the build_lines_hash logic.
The issue hash method should take into account the current mode, and get boths paths from the revision, instead of relying only on the current path.
Exemple, with a file 'test.txt' renamed to 'new_name.txt':
issue_a.path = 'test.txt'
issue_a.mode = 'before'
issue_a.build_lines_hash() # the revision will give ('test.txt', 'new_name.txt') as paths
issue_b.path = 'new_name.txt'
issue_b.mode = 'after'
issue_b.build_lines_hash() # the revision will give ('test.txt', 'new_name.txt') as paths
issue_c.path = 'file.txt'
issue_c.mode = 'after'
issue_c.build_lines_hash() # the revision will raise an Exception as file.txt is not present in the after mode
issue_d.path = 'nochange.txt'
issue_d.mode = 'after'
issue_d.build_lines_hash() # the revision will give ('nochange.txt', 'nochange.txt') as paths
- Dominant language
- Python
- Stars
- 67
- Forks
- 52
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 54
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/code-review
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
mozilla/code-review#3399 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
mozilla/code-review#3666 ·
-
Remove the frontend Open
Difficulty 5/5 Over a week Newbie friendliness 30/100
mozilla/code-review#3648 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
mozilla/code-review#3640 ·
-
mozilla/code-review#3638 · 1 assignee ·
All issues in mozilla/code-review
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100