0

Is it possible to prevent someone from pushing commit which touches already applied (committed to separate branch) database migrations?

For example, in default branch there are existing migrations 01 and 02 (already applied). In development branch someone adds migration 03 but also modifies migration 02. How to prevent this commit via mercurial hook?

Max Arnold
  • 427
  • 1
  • 5
  • 11

1 Answers1

0

You can write a pretxnchangegroup hook that checks for commits that modify an existing file in the migrations directory. Shouldn't be that hard to cobble something together with some hg API docs.

djc
  • 11,603
  • 5
  • 41
  • 54