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

Detect moved/renamed files in git as changed files #2211

Closed
bugzilla-to-github opened this issue Feb 11, 2020 · 0 comments · Fixed by #3312
Closed

Detect moved/renamed files in git as changed files #2211

bugzilla-to-github opened this issue Feb 11, 2020 · 0 comments · Fixed by #3312
Assignees
Labels
bug P2 We want to ship it soon, possibly in the current quarter sync

Comments

@bugzilla-to-github
Copy link
Collaborator

bugzilla-to-github commented Feb 11, 2020

This issue was created automatically by a script.

Bug 1614915

Bug Reporter: @Pike
CC: @mathjazz

We had to move some files around for android-l10n, and sync didn't pick them up from vcs.

That's a bug in get_changed_files:

def get_changed_files(self, path, from_revision, statuses=None):
statuses = statuses or ("A", "M")
code, output, error = self.execute(
[
"git",
"diff",
"--name-status",
"{}..HEAD".format(from_revision),
"--",
path,
],
)
if code == 0:
return [
line.split()[1]
for line in output.split("\n")
if line and line[0] in statuses
]
return []

The output of the git command is:

R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ca/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ca/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-co/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-co/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-cs/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-cs/strings.xml
M	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-cy/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-da/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-da/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-de/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-de/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-dsb/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-dsb/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-en-rCA/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-en-rCA/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-en-rGB/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-en-rGB/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-es-rAR/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-es-rAR/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-es-rCL/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-es-rCL/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-es-rES/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-es-rES/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-eu/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-eu/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-fi/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-fi/strings.xml
M	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-fr/strings.xml
M	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-fy-rNL/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ga-rIE/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ga-rIE/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-gn/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-gn/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-hr/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-hr/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-hsb/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-hsb/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-hu/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-hu/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-in/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-in/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-it/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-it/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-iw/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-iw/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ja/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ja/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-kab/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-kab/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ko/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ko/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-lo/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-lo/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-nb-rNO/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-nb-rNO/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-nl/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-nl/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-nn-rNO/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-nn-rNO/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-pa-rIN/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-pa-rIN/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-pl/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-pl/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-pt-rBR/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-pt-rBR/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-pt-rPT/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-pt-rPT/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ru/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ru/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-sk/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-sk/strings.xml
M	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-sl/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-sq/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-sq/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-sv-rSE/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-sv-rSE/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-th/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-th/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-tr/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-tr/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-uk/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-uk/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-ur/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-ur/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-vec/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-vec/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-vi/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-vi/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-zh-rCN/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-zh-rCN/strings.xml
R100	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-zh-rTW/strings.xml	mozilla-mobile/android-components/components/feature/addons/src/main/res/values-zh-rTW/strings.xml
D	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-cy/strings.xml
D	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-fr/strings.xml
D	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-fy-rNL/strings.xml
D	mozilla-mobile/android-components/components/feature/addons/src/main/res/values/values-sl/strings.xml

And there are two things at play here: Firstly, we're not checking for R1 as wanted status. And if we did, we'd need to pick the last file name, not the first.

@mathjazz mathjazz added the sync label Nov 10, 2021
@mathjazz mathjazz changed the title [sync] detect moved/renamed files in git as changed files Detect moved/renamed files in git as changed files Nov 10, 2021
@mathjazz mathjazz added P2 We want to ship it soon, possibly in the current quarter and removed P3 Default, possibly shipping in the following two quarters labels Nov 10, 2021
@mathjazz mathjazz moved this from Done to Moving and removing files in Pontoon Sync reliability Apr 4, 2024
@eemeli eemeli self-assigned this Oct 10, 2024
@eemeli eemeli mentioned this issue Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P2 We want to ship it soon, possibly in the current quarter sync
Projects
Status: Moving and removing files
Development

Successfully merging a pull request may close this issue.

3 participants