I am using TortoiseHg as my source control for developing a CMS project written in .NET/C#. I don't know how can I get a whole complete version from my source repository. Is it possible? a version for a specified date.
Thank you.
The command hg update will update your working directory to any prior version of your choice.
The command hg archive will provide you with a zipfile or tarball representing any point in history.
For both commands you can specify your exact revision using the -r argument.
Related
I did a cvs update -r "1.5" on file abc.html. The abc.html has versions until 1.10. The previous version it was in was v1.8.
Let's say I had no idea it was in v1.8 after I changed its version to v1.5. How do I use cvs to find out that the previous version of the file used was v1.8?
Or in other words, how do I use cvs to track all previous change in file version?
It's very hard to know what you mean from the wording of your question, but I think this is it... You had a workspace that was a bit old. abc.html was at version 1.8. Then you did cvs update -r 1.5 abc.html and now you want to undo that operation and get back to the version that corresponds to the date of checkout of the rest of the files in your repository. The short answer is that you cannot. CVS tracks changes on a per-file basis, not a per-directory one. Unless you know the timestamp of when you checked out the whole repository, or you have a tag that was applied to the whole repository that you were checked out to, what you want can't really be done.
Other possible things you might have meant:
The previous version to 1.x is 1.(x-1).
How many versions are there? cvs log <filename>.
What version does the current workspace have checked out? cvs status abc.html.
note: You probably do not want to do cvs update -r 1.5 abc.html as that will put a "sticky tag" on the file and it will be forever stuck at 1.5 even as you update the rest of your repository to the latest versions. For examining old versions of individual files, if cvs diff -r 1.5 abc.html is not enough, I would recommend using -p to send the output to stdout. e.g. cvs update -p -r 1.5 abc.hmtl > abc.html. Or you can even redirect it to /tmp/abc.html.
I know it is possible to download a tarball with the source code from the https://github.com/user/repo/archive/master.tar.gz.
What is the best way to determine the version from that tarball (or possibly through some API)?
Ideally, I want to get the output of git describe. Since I don't have the whole repo, I can't run it myself.
I'm using the RTC 3.0.1 CLI (lscm) and I have a file checked into a changeset that I would like to delete. There doesn't appear to be a straightforward way to do this, any idea?
I hate answering my own question, but I figured it out. Perhaps this will help others.
RTC really makes you think about source control in a different way than SVN, or even git. In order to delete a file from an RTC changeset, you just remove the file locally and checkin the directory.
$ rm myfile
$ cd ..
$ lscm checkin mydir
Undoing changes with the 'undo' command
$ lscm undo myfile
Here is a rosetta stone of sorts for the RTC CLI that clued me in:
Git v Subversion v RTC
From what I can see in the help page, there is also one workaround:
relocate a file from one change set to another.
I have a java project in NetBeans and im using Mercurial for version controlling.
I want to see my project version number in about box and i want it to be updated according to Mercurial revision number.
Any ideas how to do it? :)
Following 'Version numbering for auto builds with Mercurial', you can record in a VERSION.TXT file (that you about dialog would display) the result of:
hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'
Lazy Badger comments:
log will be a lot better (and correct) with:
hg log -r tip --template "{latesttag}.{latesttagdistance}"
You have more options in "How good is my method of embedding version numbers into my application using Mercurial hooks?"
version_gen.sh with:
hg parent --template "r{node|short}_{date|shortdate}" > version.num
In the makefile, make sure version_gen.sh is run before version.num is used to set the version parameter.
If Windows, MercurialRev ("SubWCRev for Mercurial") may be useful also
Replaces revision information in a tagged text file.
MercurialRev <SourceFile> <DestinationFile> <RepositoryPath>
Tags:
<$HG:REV_NUM$>
<$HG:REV_LMOD_N$>
<$HG:REV_LMOD_P$>
<$HG:REV_ID$>
<$HG:BRANCH$>
<$HG:TAG$>
I'm developing a Web application in Scala that we deploy in several testing environments. In order to control which software snapshot is installed, I'd like to include a version fingerprint in the generated .war so I can query it using a REST interface.
I would go in the path of setting a SBT task that retrieves the mercurial repository version, the current project version from the project definition and compose a static string that will be read from that before mentioned service, but is this the right approach?
What are common patterns for getting this functionality?
Regards.
The idea is to generate a file with the right information, and then have an SBT task taking care of including that file information in the generated war.
For the file, you can see the right mercurial command in "How to display current working copy version of an hg repository on a PHP page", as a post-update hook:
[hooks]
post-update = hg id -r > VERSION ; hg id -i >> VERSION
That means you won't have ot can any mercurial command from SBT: the update of the mercurial repo will be enough to trigger the generation of that file.
The comments of that linked answer also mention the possible hg command:
hg log -r . --template "v{latesttag}-{latesttagdistance}-{node|short}\n