Closed Bug 1435183 Opened 7 years ago Closed 7 years ago

Migration fails with 'hg annotate: option --file must not have an argument'

Categories

(Localization Infrastructure and Tools :: Fluent Migration, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: flod, Assigned: stas)

References

Details

Attachments

(1 file)

(deleted), text/x-github-pull-request
Details
Bug 1428000 introduced per-file blame. I'm trying to test the new migrations locally, by dumb-patching both compare-locales and python-fluent in mozilla-central. When running the migration, I get the error > hg annotate: option --file must not have an argument I printed out the output of cmdbuilder https://github.com/projectfluent/python-fluent/blob/master/tools/migrate/blame.py#L19 And it results in hg annotate --date --file=browser/branding/official/brand.dtd --user --template=json --cwd=/Users/flodolo/mozilla/mercurial/l10n_clones/locales/it Indeed, this fails for me with 4.5 $ hg annotate --file=foo Using this seems to work, even if it produces a strange output. Not sure if that's even close to proper Python code: args = cmdbuilder( b('annotate'), *file_paths, template='json', date=True, user=True, cwd=self.client.root()) Output: $ hg annotate --date --cwd=/Users/flodolo/mozilla/mercurial/l10n_clones/locales/it --template=json --user -- browser/branding/official/brand.dtd I double checked by manually appending a second file to file_paths, and it seems to work $ hg annotate --date --cwd=/Users/flodolo/mozilla/mercurial/l10n_clones/locales/it --template=json --user -- browser/branding/official/brand.dtd browser/branding/official/brand.properties Hopefully, there are cleaner ways to get the same result.
Blocks: 1424683
No longer blocks: 1435181
Blocks: fluent.migrate
No longer blocks: 1428000
Weird that that changed. You might not need file at all, it shows which line in the file came from which original file, IIRC. That we probably don't care about.
Yeah, it looks like something like *map(b, file_paths) could work. I'll test in a few when I finish setting this up on my machine. I really don't understand how this worked when I landed...
(In reply to Francesco Lodolo [:flod] from comment #0) > Using this seems to work, even if it produces a strange output. To clarify: strange output -> "--" at the end of the command, before the list of files
Attached file Pull Request (deleted) —
Assignee: nobody → stas
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
...and I landed a tiny follow-up which makes sure we don't try to annotate existing FTL files.
No longer blocks: fluent.migrate
Component: Python Library → Fluent Migration
Product: L20n → Localization Infrastructure and Tools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: