I have two unrelated repositories ‘public’ and ‘develop’:
prj/
public/
develop/
‘develop’ has lots of commits, ’cause here is where I work. Maybe even multiple heads
From time to time I want publish a snapshot of the development repository.
From the public folder I could do this:
>hg pull -f ../develop
>hg merge
>hg commit -m "alpha2"
But this will also pull the complete changeset history from ‘develop’ to ‘public’ (which is not what I want).
I could also delete all files from ‘public’, except for the ‘.hg’ subfolder.
Then manually copy all files from the ‘develop’ directory and do a
>hg commit -m "alpha2"
But then I have to ‘add’ new files, ‘remove’ obsolete files and ‘rename’ moved files again.
Using the -A option with commit would blindly add/remove all files, even if they were uncontrolled in the ‘development’ repository.
There must be a more efficient way to do this 😉
I’d suggest you just move over the full history, but if you can’t stomach that for some reason then you could do any of these things:
Any of those should do the same thing, but all of them are a little ugly because, in general, throwing away history is hard to do.