I'm just starting out with SVN with software I a writing and decided to install Mercurial 开发者_运维技巧(HG Tortoise) on my Win7. I have never used any version control, but I think I am slowly getting the hang of it. My workflow that I'm trying to do is this:
- Make edits to appropriate code.
- Commit the edits with a revision/tag
- Right click on the revision I want from the Hg Workbench and Create Archive to export a directory that is then ready to be sent to my clients.
Is this flow correct? If so, how do I specify that two files, .hgignore
and .hg_archival.txt
, not be archived there? This is for clients remember, not for myself or other devs, so they should see only the code.
Should I instead be checking out, or cloning, or something, then manually zipping that up?
It's very hard to find a GUI-based tutorial for Tortoise that also communicates concepts of Mercurial (I found one for GIT but I like how Tortoise integrates Win7 shell better).
Use the archivemeta = false
option of mercurial to avoid the .hg_archival.txt
file.
Use the exclude filter on .hg*
to avoid files starting with .hg
like .hgignore
Regarding archivemeta option, see: http://www.selenic.com/mercurial/hgrc.5.html
Regarding the exclusion of files in hg archive
command see http://www.selenic.com/mercurial/hg.1.html#archive which states:
create a tarball excluding .hg files:
hg archive project.tar.gz -X ".hg*"
I know this answer relates rather to the command line than to Tortoise but it should be easy to adapt.
The result of using hg archive
isn't much different than cloning and then deleting the .hg
directory. If I wanted to have a quick way of cleaning a copy/clone of the repo such that it could be delivered, I would keep a script in the root of the repo (version controlled) that deletes specific files and directories and then maybe itself.
Since Windows 7 comes with Powershell, I would probably add a function to my profile that:
- calls
hg archive
- starts the cleanup script
- deletes the cleanup script (rather than the script deleting itself)
- zips up the directory
精彩评论