hg equivalent of git push -f?

Arne Babenhauserheide arne_bab at web.de
Tue Mar 7 11:21:41 UTC 2017


Jeremy . writes:

>>Alternatively you could create a push hook which automatically strips
>>the old changesets. The following example is for bookmarks, but you
>>could also just strip away the non-tip head on a force-push.
>
>>[hooks]
>>pushkey.delete-old-history = if test x"$HG_NAMESPACE" = x"bookmarks"; then $HG strip --hidden -r "::$HG_OLD - ::$HG_NEW"; hg update $HG_KEY; fi
>
> This would give the same workflow as git, other than that they are moved immediately to a backup file instead of being hidden until GC. I wonder if it could be done as an extension?

You only need to do this on the server, so an extension seems overkill
for this.

Best wishes,
Arne




More information about the Mercurial mailing list