mercurial

Reducing repository size in Mercurial

烈酒焚心 提交于 2019-12-20 17:47:12
问题 As my team works on a given project with the source in a Mercurial repository, the repository is obviously growing in size. As such, cloning a repository over the network becomes slower and slower. Are there any techniques that are used for pruning out older commits or reducing the size of the repo to make the cloning operation faster over a slow network? (We are using TortoiseHg as the Mercurial client but that (I'm guessing) shouldn't make a difference to the solution to this problem.) 回答1:

Mercurial: Revert a single hunk

本秂侑毒 提交于 2019-12-20 17:38:36
问题 How do I revert a single hunk in Mercurial, similar to the way it's done in darcs, i.e. it asks me for each hunk and file whether I want to revert it? Is it possible using TortoiseHg? Thanks 回答1: The record extension is inspired by darcs record . It will allow you to add only specific hunks to the next commit, i.e., the opposite of what you want. But you could add all hunks except the one you want to revert and then do a hg revert to revert it. A little backwards, I know... :-) You could also

Mercurial: roll back an “hg commit --amend”.

倾然丶 夕夏残阳落幕 提交于 2019-12-20 17:37:43
问题 I accidentally did a "hg commit --amend" instead of just a commit. How can I roll back the commit to before the amend? 回答1: NOTE: This answer is now deprecated. See the answer from @Sorina Sandu instead. See hg help commit, where it says: The --amend flag can be used to amend the parent of the working directory with a new commit that contains the changes in the parent in addition to those currently reported by "hg status", if there are any. The old commit is stored in a backup bundle in ".hg

How to use Visual Studio (vsdiffmerge) as external diff tool in SourceTree for Mercurial?

筅森魡賤 提交于 2019-12-20 17:34:14
问题 I am using Mercurial for my source control and SourceTree to manage it. I want to use Visual Studio's built in diff and merge tool (vsdiffmerge) for comparing files however this is not working. I am currently using the following: Diff Commands: \"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe\" Diff Arguments: \"$LOCAL\" \"$REMOTE\" //t Merge Commands: \"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\vsdiffmerge.exe\" Merge Arguments: \"

Finding changesets in mercurial by grepping the patch

旧巷老猫 提交于 2019-12-20 17:31:20
问题 Is there a way in mercurial to find a change by giving a pattern in the edit (the changed code), as opposed to the log message or filename? I've looked pretty thoroughly in "hg help revsets" and I think there's not a good way to do this. Here's the best hack I came up with, but I'm hoping I missed a capability, or that someone can do a little better. hg log -M -u goldberg -p | grep '(^changeset:\| <pattern> )' | grep -C 1 ' <pattern> ' (and then manually selecting the revision number for

How to use Mercurial for version control of text documents?

半世苍凉 提交于 2019-12-20 14:35:10
问题 This is not exactly a programming question, however I think it fits here better than in the TeX group I want to use version control for keeping track of changes of text files (which are used to create LaTeX output. (As I am no programmer, I don't have deeper experience with version control system yet.) I'd like to use Mercurial for that, and I'm working on MacOS X 10.6. The files are about job applications, so mostly 3 files for each company: a letter of motivation a CV and one file with the

.hgignore syntax for ignoring only files, not directories?

馋奶兔 提交于 2019-12-20 13:19:05
问题 I have a problem which I can't seem to understand. I'm using TortoiseHg (version 0.7.5) on Windows but on Linux I have the same problem. Here it is: My .hgignore file: syntax: regexp ^[^\\/]+$ What I'm trying to achieve is to add to the ignore list the files which are in the root of the hg repository. For example if I have like this: .hg +mydir1 +mydir2 -myfile1 -myfile2 -anotherfile1 -anotherfile2 .hgignore I want myfile1(2) and anotherfile1(2) to be ignored (names are only for the purpose

How do I move a private Mercurial repository to a central server?

让人想犯罪 __ 提交于 2019-12-20 12:16:53
问题 I’m just getting started with Mercurial, and I’ve read Joel Spolsky’s Hg Init tutorial, which I liked. I’m wondering: let’s say I have a private repository and I work on it for about a month. Then I decide I want to centralize it or make it public, like on bitbucket.org. I want to retain all the history. The intuitive thing would be to use hg clone, but according to the docs: The location of the source is added to the new repository's .hg/hgrc file, as the default to be used for future pulls.

TortoiseHG/Mercurial Project Statistics and Reports

蓝咒 提交于 2019-12-20 12:16:12
问题 I've been working for a couple months on cleaning up the backend of a system I'm working on. The previous code was awful so I've been refactoring and rewriting to get the code to a state where I can better add and improve functionality. I want to be able to quantify the work I've done for the client so he can get a sense of how much work has been done. So, I want to run some reports showing things like: number of lines removed, added, changed. I've used TortoiseHG/Mercurial all along and also

How do I move a private Mercurial repository to a central server?

烂漫一生 提交于 2019-12-20 12:15:57
问题 I’m just getting started with Mercurial, and I’ve read Joel Spolsky’s Hg Init tutorial, which I liked. I’m wondering: let’s say I have a private repository and I work on it for about a month. Then I decide I want to centralize it or make it public, like on bitbucket.org. I want to retain all the history. The intuitive thing would be to use hg clone, but according to the docs: The location of the source is added to the new repository's .hg/hgrc file, as the default to be used for future pulls.