Closed Bug 918979 Opened 11 years ago Closed 9 years ago

Mach mercurial-setup always creates its own copies of hg extensions, doesn't (offer to) update hgrc to point to them

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: Gijs, Assigned: emorley)

Details

Attachments

(1 file)

So I had qimportbz configured myself to point to ~/some/dir/. That's a local hg repo with [paths] default = the same repo URL that mach uses. When I run ./mach mercurial-setup, it does not tell me to use this extension, but it does update its own local copy of it under ~/.mozbuild/extensions. It doesn't list the local path, just the remote one it's pulling from. In the meantime, I'm stuck on a buggy, old version of qimportbz and think that mercurial-setup is updating it for me.

Some options:

- it shouldn't bother installing stuff I've already got installed, or;
- it should update the one I've specified if it's a mercurial repository (and offer to fix any apparent wrongdoings in its default remote path settings), or;
- it should offer to overwrite the one I have with one that it'll keep up to date.
The simplest solution is to have it ignore extensions that are already installed but not managed by itself. However, this isn't very helpful to users.

The next easiest is to have it change the configuration to use the path it manages, not the previous path.

There are dangers with having it attempt to manage the already-present path. Notably, the user could be a developer of said extension and we would be performing |hg up| and friends on the working copy - something they may not desire. Also, some extensions have Git mirrors. What if we expect a Mercurial repo but encounter a Git one? That logic gets complicated fast!

My vote is to have it prompt then modify the config to point to "our" version. That's relatively safe and delivers a user benefit.
Assignee: nobody → emorley
Status: NEW → ASSIGNED
Attached patch WIPSplinter Review
Checkpointing a few bug's worth of patches.
I'm pretty sure that this (accidentally) got resolved as a side-effect of other refactoring.

Say you have the following in your ~/.hgrc:

[extensions]
bzexport = ~/src/bzexport

If I run |mach mercurial-setup| today, it will automatically prompt you to change the config to:

[extensions]
bzexport = /home/gps/.mozbuild/version-control-tools/hgext/bzexport
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
The WIP I have locally does a bit more than that iirc, I'll double check either way and either finish this up or close it out soon. Reopening so this appears again on bugzilla-todos.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
So the WIP I had locally allowed the user more control over whether to switch away from a non-version-control-tools repo location & also prompted to remove the old directories. However since the version control tools repo is now the single source of truth, and has been around for so long, I think people using the old repos are such an edge case that we should just switch them and not prompt (and cleaning up the old directories doesn't exactly matter).
Status: REOPENED → RESOLVED
Closed: 10 years ago9 years ago
Resolution: --- → WORKSFORME
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: