Closed Bug 1183282 Opened 6 years ago Closed 6 years ago

Ability to mark repositories as read-only


(Developer Services :: Mercurial:, defect)

Not set


(Not tracked)



(Reporter: gps, Assigned: gps)




(2 files)

It would be convenient if we could mark old repositories as read only. It would also be convenient to put all of in read-only mode during certain maintenances so we don't have to take the service offline to do upgrades.
Assignee: nobody → gps
readonly: add an extension that marks repositories as read-only (bug 1183282); r?dminor

Lots of repositories on are ancient and should no longer
be updated. In addition, it is desirable during some server
maintenance operations to prevent all pushes.

This commit introduces a new "readonly" extension that can be used to
mark repositories as read only. You can put a file in the .hg/ of an
individual repository to mark it read only. Or you can configure a
global read-only file to be used to mark all repositories as read only.
This satisfies both our major use cases.

It is unfortunate we can't hook into pretxnopen. However, the Mercurial
bug not showing output from this hook is a deal breaker :/
Attachment #8683363 - Flags: review?(dminor)
ansible/hg-ssh: install readonly extension (bug 1183282); r?dminor

Now that we have a basic readonly extension, configure it on

We install the extension on the SSH server, which is the only place
where we need to be locking out writes.
Attachment #8683364 - Flags: review?(dminor)
Blocks: 1188219
Attachment #8683363 - Flags: review?(dminor) → review+
Comment on attachment 8683363 [details]
MozReview Request: readonly: add an extension that marks repositories as read-only (bug 1183282); r?dminor

::: hgext/readonly/
(Diff revision 1)
> +testedwith = '3.5 3.5'

Is 3.5 repeated here intentionally?

::: hgext/readonly/
(Diff revision 1)
> +        # Repo local file does not exist. Fall through.

nit: unindent this comment and remove the following empty line so it is above
rf = ui.config(....
Comment on attachment 8683364 [details]
MozReview Request: ansible/hg-ssh: install readonly extension (bug 1183282); r?dminor
Attachment #8683364 - Flags: review?(dminor) → review+
Deploying now.
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.