Have "hg strip" blacklist stripped revisions?
Kevin Bullock
kbullock+mercurial at ringworld.org
Fri Nov 5 02:47:40 UTC 2010
(switching from -devel to user list)
On 4 Nov 2010, at 9:15 PM, CG Linden wrote:
> An idea...
>
> After multiple occurrences of people committing back stripped revisions, I was wondering if it was possible to include a feature that would add changesets to a blacklist, and have pull/push fail if one of the blacklisted revs is to be included.
This is possible with a pretxnchangegroup hook on the central repo. I have this for one of my repos to blacklist a stripped branch:
[hooks]
pretxnchangegroup.stripdm = hg branches | awk '/^dm-edge/ { print "Please strip the dm-edge branch before pushing"; exit 1 }'
It even has a nice informative message. (Note this is likely only seen when pushing over ssh; I don't think the HTTP wire protocol captures remote stdout.)
You could blacklist particular changesets a similar way, with a shell script as the hook and a text file listing the bad cset ids; something like
#!/bin/sh
for cset in $(hg log --template '{node|short}\n' -r $HG_NODE:tip); do
grep -Fq $cset stripped-changesets.txt && (echo Please strip blacklisted changeset $cset; exit 1)
done
exit 0
(assuming *n*x, untested, off the cuff, fear, fire, foes, warnings, etc.)
> I realize that full scale history editing may be more desirable, but this seems like a simple addition that doesn't go against the grain of mercurial's fundamental 'append only' design.
'strip' already goes against the core append-only design, which is why it's in an extension (MQ).
pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock
> Obviously, --force should override...
> --
> cg
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
More information about the Mercurial
mailing list