QuestionId
stringlengths
3
8
QuestionTitle
stringlengths
15
149
QuestionScore
int64
1
27.2k
QuestionCreatedUtc
stringdate
2008-08-01 18:33:08
2025-06-16 04:59:48
QuestionBodyHtml
stringlengths
40
28.2k
QuestionViewCount
int64
78
16.5M
QuestionOwnerUserId
float64
4
25.2M
QuestionLastActivityUtc
stringdate
2008-09-08 19:26:01
2026-01-24 22:40:25
AcceptedAnswerId
int64
266
79.7M
AnswerScore
int64
2
30.1k
AnswerCreatedUtc
stringdate
2008-08-01 23:40:28
2025-06-16 05:23:39
AnswerOwnerUserId
float64
1
29.5M
AnswerLastActivityUtc
stringdate
2008-08-01 23:40:28
2026-01-23 17:46:09
QuestionLink
stringlengths
31
36
AnswerLink
stringlengths
31
36
AnswerBodyHtml
stringlengths
35
33k
AnswerBodyPreview
stringlengths
35
400
AllTagIdsCsv
stringlengths
2
37
AllTagNamesCsv
stringlengths
2
106
MergedQuestion
stringlengths
74
28.4k
quality_filter
stringclasses
10 values
unique_id
int64
0
29k
tag_major_lang
stringclasses
10 values
MergedQuestion_md
stringlengths
60
28.1k
AnswerBodyHtml_md
stringlengths
14
29.2k
5707962
How to merge two branches in Mercurial when there is nothing to merge
36
2011-04-18 19:37:59
<p>I'm new to mercurial and I'm trying to do something really simple but can't figure out how to. I created a branch to do some experimentation without disturbing the main branch.</p> <pre><code>trunk A -- B -- C \ experiment D -- E -- F </code></pre> <p>I like how the experi...
56,485
540,981
2018-02-22 12:34:42
5,708,185
69
2011-04-18 19:59:13
267
2011-04-18 19:59:13
https://stackoverflow.com/q/5707962
https://stackoverflow.com/a/5708185
<p>Merging in Mercurial always work the following way:</p> <ol> <li>Update to one of the branches (see notes below for why you want to pick one or the other and not just pick a random branch)</li> <li>Merge with the other branch</li> </ol> <p>For instance, in your case, you would do:</p> <pre><code>hg update trunk h...
<p>Merging in Mercurial always work the following way:</p> <ol> <li>Update to one of the branches (see notes below for why you want to pick one or the other and not just pick a random branch)</li> <li>Merge with the other branch</li> </ol> <p>For instance, in your case, you would do:</p> <pre><code>hg update trunk h...
456, 717, 802
mercurial, merge, version-control
<h1>How to merge two branches in Mercurial when there is nothing to merge</h1> <p>I'm new to mercurial and I'm trying to do something really simple but can't figure out how to. I created a branch to do some experimentation without disturbing the main branch.</p> <pre><code>trunk A -- B -- C ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,875
mercurial
# How to merge two branches in Mercurial when there is nothing to merge I'm new to mercurial and I'm trying to do something really simple but can't figure out how to. I created a branch to do some experimentation without disturbing the main branch. ``` trunk A -- B -- C \ experiment ...
Merging in Mercurial always work the following way: 1. Update to one of the branches (see notes below for why you want to pick one or the other and not just pick a random branch) 2. Merge with the other branch For instance, in your case, you would do: ``` hg update trunk hg merge experiment ``` ## Choosing the righ...
2506803
Difference between Revert and Update in Mercurial
53
2010-03-24 10:21:14
<p>I'm just getting started with Mercurial, and I've come across something which I don't understand.</p> <p>I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific file).</p> <p>As far as I can see, the command I want is <a href="h...
10,613
175,645
2018-02-22 10:09:26
2,507,155
66
2010-03-24 11:18:07
207,716
2013-03-09 09:28:38
https://stackoverflow.com/q/2506803
https://stackoverflow.com/a/2507155
<p>The first difference is revert can work on a subset of the working copy while update works on the whole working copy. the other difference is in what happens when you want to go back to a version other than the last committed one.</p> <p>if we have revisions (caps are committed, lower case are changes in the workin...
<p>The first difference is revert can work on a subset of the working copy while update works on the whole working copy. the other difference is in what happens when you want to go back to a version other than the last committed one.</p> <p>if we have revisions (caps are committed, lower case are changes in the workin...
456, 802
mercurial, version-control
<h1>Difference between Revert and Update in Mercurial</h1> <p>I'm just getting started with Mercurial, and I've come across something which I don't understand.</p> <p>I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific file).</p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,876
mercurial
# Difference between Revert and Update in Mercurial I'm just getting started with Mercurial, and I've come across something which I don't understand. I made changes to several files, and now I want to undo all the changes I made to one of them (i.e. go back to my last commit for one specific file). As far as I can s...
The first difference is revert can work on a subset of the working copy while update works on the whole working copy. the other difference is in what happens when you want to go back to a version other than the last committed one. if we have revisions (caps are committed, lower case are changes in the working copy, pa...
3316012
Can Mercurial use .hgignore to forget files?
38
2010-07-23 07:08:57
<p>I forget to place the correct .hgignore into my project and am now confronted with many useless files in my repository. As these files are already under source control .hgignore will not pick em up.</p> <p>Is there a way for hg to forget all files matched by .hgignore?</p>
4,970
131,773
2018-12-04 09:09:46
6,802,316
66
2011-07-23 18:11:05
75,761
2011-07-23 18:11:05
https://stackoverflow.com/q/3316012
https://stackoverflow.com/a/6802316
<p><a href="http://www.selenic.com/hg/help/filesets">filesets</a> awesomeness (requires 1.9):</p> <pre><code>hg forget "set:hgignore() and not ignored()" </code></pre>
<p><a href="http://www.selenic.com/hg/help/filesets">filesets</a> awesomeness (requires 1.9):</p> <pre><code>hg forget "set:hgignore() and not ignored()" </code></pre>
802
mercurial
<h1>Can Mercurial use .hgignore to forget files?</h1> <p>I forget to place the correct .hgignore into my project and am now confronted with many useless files in my repository. As these files are already under source control .hgignore will not pick em up.</p> <p>Is there a way for hg to forget all files matched by .hg...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,877
mercurial
# Can Mercurial use .hgignore to forget files? I forget to place the correct .hgignore into my project and am now confronted with many useless files in my repository. As these files are already under source control .hgignore will not pick em up. Is there a way for hg to forget all files matched by .hgignore?
[filesets](http://www.selenic.com/hg/help/filesets) awesomeness (requires 1.9): ``` hg forget "set:hgignore() and not ignored()" ```
3391262
hg: how do I push newly created branch back into central repository?
31
2010-08-02 19:55:06
<p>I cloned the centeral repository via </p> <pre><code>hg clone my_project my_project_1 </code></pre> <p>then after switching to a newly created repo I marked as a new branch</p> <pre><code>hg branch v1 </code></pre> <p>While inside the new clone I issued </p> <pre><code>hg ci -m "branch created" </code></pre> <...
40,497
314,545
2010-08-02 20:26:05
3,391,454
66
2010-08-02 20:26:05
19,465
2010-08-02 20:26:05
https://stackoverflow.com/q/3391262
https://stackoverflow.com/a/3391454
<p>It depends on the version of Mercurial that you're using. The command used to be <code>hg push -f ...</code> or <code>hg push --force ...</code> to force the creation of a new branch in the remote repository (which is usually OK). </p> <p>However, using <code>-f</code> also allows you to create new heads in the r...
<p>It depends on the version of Mercurial that you're using. The command used to be <code>hg push -f ...</code> or <code>hg push --force ...</code> to force the creation of a new branch in the remote repository (which is usually OK). </p> <p>However, using <code>-f</code> also allows you to create new heads in the r...
456, 802
mercurial, version-control
<h1>hg: how do I push newly created branch back into central repository?</h1> <p>I cloned the centeral repository via </p> <pre><code>hg clone my_project my_project_1 </code></pre> <p>then after switching to a newly created repo I marked as a new branch</p> <pre><code>hg branch v1 </code></pre> <p>While inside the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,878
mercurial
# hg: how do I push newly created branch back into central repository? I cloned the centeral repository via ``` hg clone my_project my_project_1 ``` then after switching to a newly created repo I marked as a new branch ``` hg branch v1 ``` While inside the new clone I issued ``` hg ci -m "branch created" ``` but...
It depends on the version of Mercurial that you're using. The command used to be `hg push -f ...` or `hg push --force ...` to force the creation of a new branch in the remote repository (which is usually OK). However, using `-f` also allows you to create new heads in the remote repository (usually **not** OK), so curr...
1156152
How do I "switch" with Mercurial
64
2009-07-20 21:48:46
<p>How do I do what <code>svn switch</code> does, in Mercurial?</p> <p>That is change my working directory to switch to another branch in the repository?</p>
45,407
141,678
2016-10-24 11:24:48
1,156,165
65
2009-07-20 21:51:58
108,168
2015-03-25 18:36:19
https://stackoverflow.com/q/1156152
https://stackoverflow.com/a/1156165
<pre><code>hg update -r&lt;REV&gt; </code></pre> <p>The <a href="http://www.selenic.com/hg/help/update" rel="noreferrer">update</a> command will switch to a specified revision.</p>
<pre><code>hg update -r&lt;REV&gt; </code></pre> <p>The <a href="http://www.selenic.com/hg/help/update" rel="noreferrer">update</a> command will switch to a specified revision.</p>
63, 456, 802, 3346
dvcs, mercurial, svn, version-control
<h1>How do I "switch" with Mercurial</h1> <p>How do I do what <code>svn switch</code> does, in Mercurial?</p> <p>That is change my working directory to switch to another branch in the repository?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,879
mercurial
# How do I "switch" with Mercurial How do I do what `svn switch` does, in Mercurial? That is change my working directory to switch to another branch in the repository?
``` hg update -r<REV> ``` The [update](http://www.selenic.com/hg/help/update) command will switch to a specified revision.
19270303
Why do I need hg update after hg pull while in git I'm doing only git pull
39
2013-10-09 11:05:00
<p>In <code>git</code> to pull and use the latest changes to my local repository I'm using <code>git pull</code>.</p> <p>In <code>hg</code>, I also use <code>hg pull</code> but it prints then </p> <p><strong>run 'hg update' to get a working copy</strong></p> <p>I do run <code>hg update</code> but I wonder why is thi...
19,316
721,079
2018-11-19 12:45:41
22,444,400
65
2014-03-16 23:14:51
102,182
2014-03-16 23:14:51
https://stackoverflow.com/q/19270303
https://stackoverflow.com/a/22444400
<p>The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?</p> <p>In Mercurial, <code>pull</code> is the opposite of <code>push</code>: it syncs the local repo with a remote repo without touching the working copy. So it's more co...
<p>The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference?</p> <p>In Mercurial, <code>pull</code> is the opposite of <code>push</code>: it syncs the local repo with a remote repo without touching the working copy. So it's more co...
119, 802
git, mercurial
<h1>Why do I need hg update after hg pull while in git I'm doing only git pull</h1> <p>In <code>git</code> to pull and use the latest changes to my local repository I'm using <code>git pull</code>.</p> <p>In <code>hg</code>, I also use <code>hg pull</code> but it prints then </p> <p><strong>run 'hg update' to get a w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,880
mercurial
# Why do I need hg update after hg pull while in git I'm doing only git pull In `git` to pull and use the latest changes to my local repository I'm using `git pull`. In `hg`, I also use `hg pull` but it prints then **run 'hg update' to get a working copy** I do run `hg update` but I wonder why is this difference fr...
The other answers don't actually answer the question, which is: why don't Git and Mercurial work the same? Is there a philosophical difference? In Mercurial, `pull` is the opposite of `push`: it syncs the local repo with a remote repo without touching the working copy. So it's more consistent. In Git, `pull` is a `fe...
30014241
UIImageView pinch zoom swift
93
2015-05-03 13:15:05
<p>I was hoping someone could help me out. I am trying to allow a user to pinch zoom on a UIImageView(with a max and min level allowed). But for some reason the it does not work right. The image zooms a little then just bounces back. Thank you.</p> <p>here is the zoom func</p> <pre><code>func zoom(sender:UIPinchGestu...
137,912
4,837,750
2024-09-23 22:24:46
30,014,652
64
2015-05-03 13:57:35
4,837,750
2018-04-03 15:14:19
https://stackoverflow.com/q/30014241
https://stackoverflow.com/a/30014652
<p>I decided to add the imageView to a UIScrollView. It allows the user to zoom and pan over. Here is the code I used.</p> <p>in order to set max/min zoom I used :</p> <pre><code> scrollImg.minimumZoomScale = 1.0 scrollImg.maximumZoomScale = 10.0 </code></pre> <p>here is the rest of the code. </p> <pre><code...
<p>I decided to add the imageView to a UIScrollView. It allows the user to zoom and pan over. Here is the code I used.</p> <p>in order to set max/min zoom I used :</p> <pre><code> scrollImg.minimumZoomScale = 1.0 scrollImg.maximumZoomScale = 10.0 </code></pre> <p>here is the rest of the code. </p> <pre><code...
26084, 77205, 104797
swift, uiimageview, uipinchgesturerecognizer
<h1>UIImageView pinch zoom swift</h1> <p>I was hoping someone could help me out. I am trying to allow a user to pinch zoom on a UIImageView(with a max and min level allowed). But for some reason the it does not work right. The image zooms a little then just bounces back. Thank you.</p> <p>here is the zoom func</p> <p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,882
mercurial
# UIImageView pinch zoom swift I was hoping someone could help me out. I am trying to allow a user to pinch zoom on a UIImageView(with a max and min level allowed). But for some reason the it does not work right. The image zooms a little then just bounces back. Thank you. here is the zoom func ``` func zoom(sender:U...
I decided to add the imageView to a UIScrollView. It allows the user to zoom and pan over. Here is the code I used. in order to set max/min zoom I used : ``` scrollImg.minimumZoomScale = 1.0 scrollImg.maximumZoomScale = 10.0 ``` here is the rest of the code. ``` var vWidth = self.view.frame.width va...
3326440
Remove all deleted files in next commit with Mercurial
55
2010-07-24 19:02:05
<p>Let's say I have the current <code>status</code>:</p> <pre><code>M File1.cs M File2.cs M File3.cs ! File4.cs ! File5.cs ! File6.cs </code></pre> <p>How do I bulk <code>remove</code> files 4, 5, 6 (<code>!</code>) from the next commit? </p> <p>At the moment, I am just removing them manually before committing, like...
20,579
44,084
2015-02-05 20:14:13
3,326,645
64
2010-07-24 19:55:16
8,992
2010-07-24 19:55:16
https://stackoverflow.com/q/3326440
https://stackoverflow.com/a/3326645
<p>Run <code>hg addremove</code></p>
<p>Run <code>hg addremove</code></p>
802
mercurial
<h1>Remove all deleted files in next commit with Mercurial</h1> <p>Let's say I have the current <code>status</code>:</p> <pre><code>M File1.cs M File2.cs M File3.cs ! File4.cs ! File5.cs ! File6.cs </code></pre> <p>How do I bulk <code>remove</code> files 4, 5, 6 (<code>!</code>) from the next commit? </p> <p>At the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,883
mercurial
# Remove all deleted files in next commit with Mercurial Let's say I have the current `status`: ``` M File1.cs M File2.cs M File3.cs ! File4.cs ! File5.cs ! File6.cs ``` How do I bulk `remove` files 4, 5, 6 (`!`) from the next commit? At the moment, I am just removing them manually before committing, like such: ``...
Run `hg addremove`
5371159
What is the difference between rollback, backout and strip in the Mercurial Eclipse plugin?
52
2011-03-20 20:07:06
<p>What is the difference between the menu items rollback, backout and strip in the Mercurial Eclipse plugin?</p> <p>Can I delete the commit in the local repository without modify the files in my workspace with one of this 3 commands?</p> <p>Or is there another solution how I can commit and push a fix on another part...
40,037
12,631
2011-03-20 20:20:20
5,371,252
63
2011-03-20 20:20:20
8,992
2011-03-20 20:20:20
https://stackoverflow.com/q/5371159
https://stackoverflow.com/a/5371252
<p>These commands all come from Mercurial itself, and there are plenty of good compare/contrast posts for them. However, here they are in brief:</p> <ul> <li><code>rollback</code>: one-level undo. Will undo the last pull or commit (<strong>can be dangerous</strong>)</li> <li><code>backout</code>: create a new commit...
<p>These commands all come from Mercurial itself, and there are plenty of good compare/contrast posts for them. However, here they are in brief:</p> <ul> <li><code>rollback</code>: one-level undo. Will undo the last pull or commit (<strong>can be dangerous</strong>)</li> <li><code>backout</code>: create a new commit...
53, 802, 12196
eclipse, mercurial, rollback
<h1>What is the difference between rollback, backout and strip in the Mercurial Eclipse plugin?</h1> <p>What is the difference between the menu items rollback, backout and strip in the Mercurial Eclipse plugin?</p> <p>Can I delete the commit in the local repository without modify the files in my workspace with one of ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,884
mercurial
# What is the difference between rollback, backout and strip in the Mercurial Eclipse plugin? What is the difference between the menu items rollback, backout and strip in the Mercurial Eclipse plugin? Can I delete the commit in the local repository without modify the files in my workspace with one of this 3 commands?...
These commands all come from Mercurial itself, and there are plenty of good compare/contrast posts for them. However, here they are in brief: - `rollback`: one-level undo. Will undo the last pull or commit (**can be dangerous**) - `backout`: create a new commit that is the inverse of a given commit. Net effect is an u...
3183064
Git vs Mercurial vs SVN
51
2010-07-06 01:54:21
<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/1218471/for-home-projects-can-mercurial-or-git-or-other-dvcs-provide-more-advantages-o">For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion?</a><br> <a href="https://s...
76,786
375,106
2017-10-03 15:52:11
3,183,093
63
2010-07-06 02:04:09
376,821
2017-10-03 15:52:11
https://stackoverflow.com/q/3183064
https://stackoverflow.com/a/3183093
<p>SVN is different from Git and Mercurial, in that it is a single repository that all users have to pull and commit to.</p> <p>Git and Mercurial have a distributed model. This means that there is a repository on every computer and there is usually an "Official" repository that people will choose to commit their chang...
<p>SVN is different from Git and Mercurial, in that it is a single repository that all users have to pull and commit to.</p> <p>Git and Mercurial have a distributed model. This means that there is a repository on every computer and there is usually an "Official" repository that people will choose to commit their chang...
63, 119, 456, 802
git, mercurial, svn, version-control
<h1>Git vs Mercurial vs SVN</h1> <blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/1218471/for-home-projects-can-mercurial-or-git-or-other-dvcs-provide-more-advantages-o">For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subvers...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,885
mercurial
# Git vs Mercurial vs SVN > **Possible Duplicates:** > [For home projects, can Mercurial or Git (or other DVCS) provide more advantages over Subversion?](https://stackoverflow.com/questions/1218471/for-home-projects-can-mercurial-or-git-or-other-dvcs-provide-more-advantages-o) > [What are the relative strengths an...
SVN is different from Git and Mercurial, in that it is a single repository that all users have to pull and commit to. Git and Mercurial have a distributed model. This means that there is a repository on every computer and there is usually an "Official" repository that people will choose to commit their changes to and ...
1078881
Mercurial: Merging one file between branches in one repo
54
2009-07-03 11:09:22
<p>When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged?</p> <p>Is it possible to merge only certain files, instead of whole changeset?</p>
19,471
35,425
2022-06-07 19:41:06
13,080,661
62
2012-10-26 04:19:10
1,051,115
2022-06-07 19:41:06
https://stackoverflow.com/q/1078881
https://stackoverflow.com/a/13080661
<p>WARNING: a &quot;dummy merge&quot;, as is <a href="https://stackoverflow.com/a/1079497/3195477">recommended by @Martin_Geisler</a>, can really mess you up, if later you want to do a true merge of the two branches. The dummy merge will be recorded, and say that you merge into the branch you did the dummy merge to -- ...
<p>WARNING: a &quot;dummy merge&quot;, as is <a href="https://stackoverflow.com/a/1079497/3195477">recommended by @Martin_Geisler</a>, can really mess you up, if later you want to do a true merge of the two branches. The dummy merge will be recorded, and say that you merge into the branch you did the dummy merge to -- ...
456, 802, 3346, 53847
branching-and-merging, dvcs, mercurial, version-control
<h1>Mercurial: Merging one file between branches in one repo</h1> <p>When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged?</p> <p>Is it possible to merge only certain files, instead of whole changeset?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,886
mercurial
# Mercurial: Merging one file between branches in one repo When I have two branches in Hg repo, how to merge only one file with another branch, without having all other files from changeset merged? Is it possible to merge only certain files, instead of whole changeset?
WARNING: a "dummy merge", as is [recommended by @Martin_Geisler](https://stackoverflow.com/a/1079497/3195477), can really mess you up, if later you want to do a true merge of the two branches. The dummy merge will be recorded, and say that you merge into the branch you did the dummy merge to -- you will not see the cha...
4154382
View differences between two changesets on one file
54
2010-11-11 12:28:48
<p>I have a file tracked in Mercurial. I can see its history with <code>hg log</code>. How can I see the diffs between its most recent version, and the last checked-in changeset?</p>
35,382
267,831
2017-10-24 03:19:10
4,154,405
62
2010-11-11 12:31:48
338,488
2017-02-27 22:01:33
https://stackoverflow.com/q/4154382
https://stackoverflow.com/a/4154405
<p><code>hg diff -r &lt;first_revision_number&gt;:&lt;other_revision_number&gt; filename</code></p> <p>that will do it</p> <p>e.g <code>hg diff -r 0:1 default.aspx</code></p> <p>hope it helps</p>
<p><code>hg diff -r &lt;first_revision_number&gt;:&lt;other_revision_number&gt; filename</code></p> <p>that will do it</p> <p>e.g <code>hg diff -r 0:1 default.aspx</code></p> <p>hope it helps</p>
802
mercurial
<h1>View differences between two changesets on one file</h1> <p>I have a file tracked in Mercurial. I can see its history with <code>hg log</code>. How can I see the diffs between its most recent version, and the last checked-in changeset?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,887
mercurial
# View differences between two changesets on one file I have a file tracked in Mercurial. I can see its history with `hg log`. How can I see the diffs between its most recent version, and the last checked-in changeset?
`hg diff -r <first_revision_number>:<other_revision_number> filename` that will do it e.g `hg diff -r 0:1 default.aspx` hope it helps
31223639
Mercurial: how to undo last unpushed commit?
50
2015-07-04 17:58:31
<p>I have accidentally made a commit to my local repository. To be more specific, I committed changes to lots of files all at once, when I meant to commit them one at a time. </p> <p>How do I undo this commit and get my working copy back to the state it was before the commit so I can do what I should have done in the ...
34,347
685,984
2019-05-05 05:50:58
31,277,388
62
2015-07-07 19:14:12
671,373
2018-07-18 18:15:17
https://stackoverflow.com/q/31223639
https://stackoverflow.com/a/31277388
<p>Based on information from <a href="https://stackoverflow.com/questions/13112280/mercurial-hg-equivalent-of-git-reset-mixed-or-soft">this question</a>:</p> <p><code>hg strip --keep --rev .</code><br> <code>--keep: do not modify working directory during strip</code><br> <code>--rev .</code> (the dot denotes the last...
<p>Based on information from <a href="https://stackoverflow.com/questions/13112280/mercurial-hg-equivalent-of-git-reset-mixed-or-soft">this question</a>:</p> <p><code>hg strip --keep --rev .</code><br> <code>--keep: do not modify working directory during strip</code><br> <code>--rev .</code> (the dot denotes the last...
802
mercurial
<h1>Mercurial: how to undo last unpushed commit?</h1> <p>I have accidentally made a commit to my local repository. To be more specific, I committed changes to lots of files all at once, when I meant to commit them one at a time. </p> <p>How do I undo this commit and get my working copy back to the state it was before ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,888
mercurial
# Mercurial: how to undo last unpushed commit? I have accidentally made a commit to my local repository. To be more specific, I committed changes to lots of files all at once, when I meant to commit them one at a time. How do I undo this commit and get my working copy back to the state it was before the commit so I c...
Based on information from [this question](https://stackoverflow.com/questions/13112280/mercurial-hg-equivalent-of-git-reset-mixed-or-soft): `hg strip --keep --rev .` `--keep: do not modify working directory during strip` `--rev .` (the dot denotes the last commit. read sid0's answer regarding descendants) --- Fo...
4880322
How to only push to one branch in Hg?
57
2011-02-02 21:54:58
<p>I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). <em>hg heads</em> shows 3 heads, one for each branch, even though <em>hg branches</em> shows 2 of those branches as 'inactive'.</p> <p>When I try to push my default branch (using <em>hg pu...
54,207
600,698
2014-02-04 20:46:46
4,880,549
61
2011-02-02 22:16:54
8,992
2013-01-24 04:12:38
https://stackoverflow.com/q/4880322
https://stackoverflow.com/a/4880549
<p>If changesets on <code>default</code> have ancestor changesets on other branchs you have to push those changesets too. It's not possible for a changeset to exist in a repo without all of its changesets also existing.</p> <p>So try:</p> <pre><code>hg push --branch default --new-branch </code></pre> <p>which says ...
<p>If changesets on <code>default</code> have ancestor changesets on other branchs you have to push those changesets too. It's not possible for a changeset to exist in a repo without all of its changesets also existing.</p> <p>So try:</p> <pre><code>hg push --branch default --new-branch </code></pre> <p>which says ...
717, 802, 1879, 4236
branch, mercurial, merge, push
<h1>How to only push to one branch in Hg?</h1> <p>I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). <em>hg heads</em> shows 3 heads, one for each branch, even though <em>hg branches</em> shows 2 of those branches as 'inactive'.</p> <p>When I...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,890
mercurial
# How to only push to one branch in Hg? I have a Hg repo with 3 branches in it, but two of them are inactive (since I have already merged them into my default branch). *hg heads* shows 3 heads, one for each branch, even though *hg branches* shows 2 of those branches as 'inactive'. When I try to push my default branch...
If changesets on `default` have ancestor changesets on other branchs you have to push those changesets too. It's not possible for a changeset to exist in a repo without all of its changesets also existing. So try: ``` hg push --branch default --new-branch ``` which says "yeah, I know this push sends across a branch ...
8942022
Refetching a locally deleted file from Mercurial
41
2012-01-20 13:18:06
<p>I deleted one of the files that was in my repository <em>locally</em> (just at the file system level, not using <code>hg remove</code>). I now want to get that file back from the repository to my local directory. When I do <code>hg status</code>, it knows that the file is locally deleted, but there are no changes to...
19,622
1,124,466
2018-10-14 13:25:57
8,942,048
60
2012-01-20 13:21:06
null
2014-01-07 18:54:22
https://stackoverflow.com/q/8942022
https://stackoverflow.com/a/8942048
<pre><code>$ hg revert your-file </code></pre> <p>will restore it.</p> <p><strong>Edit:</strong> see <a href="http://www.selenic.com/mercurial/hg.1.html#revert">http://www.selenic.com/mercurial/hg.1.html#revert</a></p>
<pre><code>$ hg revert your-file </code></pre> <p>will restore it.</p> <p><strong>Edit:</strong> see <a href="http://www.selenic.com/mercurial/hg.1.html#revert">http://www.selenic.com/mercurial/hg.1.html#revert</a></p>
802, 135125
hg-revert, mercurial
<h1>Refetching a locally deleted file from Mercurial</h1> <p>I deleted one of the files that was in my repository <em>locally</em> (just at the file system level, not using <code>hg remove</code>). I now want to get that file back from the repository to my local directory. When I do <code>hg status</code>, it knows tha...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,891
mercurial
# Refetching a locally deleted file from Mercurial I deleted one of the files that was in my repository *locally* (just at the file system level, not using `hg remove`). I now want to get that file back from the repository to my local directory. When I do `hg status`, it knows that the file is locally deleted, but the...
``` $ hg revert your-file ``` will restore it. **Edit:** see <http://www.selenic.com/mercurial/hg.1.html#revert>
4148234
How can you clone a Mercurial repository as of a specific changeset?
41
2010-11-10 19:24:20
<p>How can you clone a Mercurial repository as of a specific changeset?</p> <p>Ie: If the master repo has changesets 1-10, how can get a copy of the source as it existed in changeset #7?</p>
30,979
47,281
2010-11-10 19:27:48
4,148,267
60
2010-11-10 19:27:48
282,098
2010-11-10 19:27:48
https://stackoverflow.com/q/4148234
https://stackoverflow.com/a/4148267
<p>This command tells to use -r / --rev switch:</p> <pre><code>hg help clone </code></pre> <p>So :</p> <pre><code>hg clone -r 7 </code></pre>
<p>This command tells to use -r / --rev switch:</p> <pre><code>hg help clone </code></pre> <p>So :</p> <pre><code>hg clone -r 7 </code></pre>
802, 3050
clone, mercurial
<h1>How can you clone a Mercurial repository as of a specific changeset?</h1> <p>How can you clone a Mercurial repository as of a specific changeset?</p> <p>Ie: If the master repo has changesets 1-10, how can get a copy of the source as it existed in changeset #7?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,892
mercurial
# How can you clone a Mercurial repository as of a specific changeset? How can you clone a Mercurial repository as of a specific changeset? Ie: If the master repo has changesets 1-10, how can get a copy of the source as it existed in changeset #7?
This command tells to use -r / --rev switch: ``` hg help clone ``` So : ``` hg clone -r 7 ```
13549931
Create a new branch at a certain revision
39
2012-11-25 09:53:49
<p>With mercurial it is easy to create a tag at a certain revision: <code>hg tag -r &lt;revision&gt; &lt;tag-name&gt;</code>. But how to create a branch at a certain revision?</p>
44,252
209,706
2018-07-12 21:04:48
13,550,029
60
2012-11-25 10:09:08
960,558
2018-07-12 21:04:48
https://stackoverflow.com/q/13549931
https://stackoverflow.com/a/13550029
<p><strong>Preface:</strong> Mercurial branches are two types:</p> <ul> <li>named branch</li> <li>anonymous</li> </ul> <h2>Named Branch</h2> <p>In order to get named branch BRANCHNAME, starting at REV</p> <pre><code>hg update REV hg branch BRANCHNAME ... hg commit </code></pre> <p>commit is a must, because</p> <b...
<p><strong>Preface:</strong> Mercurial branches are two types:</p> <ul> <li>named branch</li> <li>anonymous</li> </ul> <h2>Named Branch</h2> <p>In order to get named branch BRANCHNAME, starting at REV</p> <pre><code>hg update REV hg branch BRANCHNAME ... hg commit </code></pre> <p>commit is a must, because</p> <b...
802
mercurial
<h1>Create a new branch at a certain revision</h1> <p>With mercurial it is easy to create a tag at a certain revision: <code>hg tag -r &lt;revision&gt; &lt;tag-name&gt;</code>. But how to create a branch at a certain revision?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,893
mercurial
# Create a new branch at a certain revision With mercurial it is easy to create a tag at a certain revision: `hg tag -r <revision> <tag-name>`. But how to create a branch at a certain revision?
**Preface:** Mercurial branches are two types: - named branch - anonymous ## Named Branch In order to get named branch BRANCHNAME, starting at REV ``` hg update REV hg branch BRANCHNAME ... hg commit ``` commit is a must, because > the branch will not exist in the repository until the next commit as noted in `hg...
12709422
Mercurial .hgignore for Visual Studio 2012 projects
37
2012-10-03 13:22:00
<p>I currently use the answer to a similar question for <a href="https://gist.github.com/4690206" rel="noreferrer">Visual Studio 2010</a> as my go to hgignore file. Are there any notable additions to include with VS2012?</p> <hr> <p>Below is a compiled list from many different sources. Gist <a href="https://gist.gith...
9,913
608,694
2016-10-16 07:17:21
12,981,198
60
2012-10-19 19:31:38
169,153
2016-10-16 07:17:21
https://stackoverflow.com/q/12709422
https://stackoverflow.com/a/12981198
<p>By pulling from <a href="https://stackoverflow.com/questions/4095696/mercurial-hgignore-for-visual-studio-2010-projects/4095783#4095783">this</a> previous answer about Visual Studio 2010, from <a href="https://stackoverflow.com/questions/12709422/mercurial-hgignore-for-visual-studio-2012-projects/12719725#12719725">...
<p>By pulling from <a href="https://stackoverflow.com/questions/4095696/mercurial-hgignore-for-visual-studio-2010-projects/4095783#4095783">this</a> previous answer about Visual Studio 2010, from <a href="https://stackoverflow.com/questions/12709422/mercurial-hgignore-for-visual-studio-2012-projects/12719725#12719725">...
802, 31419, 33953, 80825
hgignore, mercurial, visual-studio, visual-studio-2012
<h1>Mercurial .hgignore for Visual Studio 2012 projects</h1> <p>I currently use the answer to a similar question for <a href="https://gist.github.com/4690206" rel="noreferrer">Visual Studio 2010</a> as my go to hgignore file. Are there any notable additions to include with VS2012?</p> <hr> <p>Below is a compiled list...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,894
mercurial
# Mercurial .hgignore for Visual Studio 2012 projects I currently use the answer to a similar question for [Visual Studio 2010](https://gist.github.com/4690206) as my go to hgignore file. Are there any notable additions to include with VS2012? --- Below is a compiled list from many different sources. Gist [here](htt...
By pulling from [this](https://stackoverflow.com/questions/4095696/mercurial-hgignore-for-visual-studio-2010-projects/4095783#4095783) previous answer about Visual Studio 2010, from [this](https://stackoverflow.com/questions/12709422/mercurial-hgignore-for-visual-studio-2012-projects/12719725#12719725) response in this...
3643313
Mercurial: copying ONE file and its history to another repository
51
2010-09-04 17:33:41
<p>I'm wondering if I can copy one file and its history from one repository to another, without having to import the <em>whole</em> other repository.</p>
10,504
207,655
2016-06-20 14:02:52
3,643,519
59
2010-09-04 18:41:31
19,465
2016-06-20 14:02:52
https://stackoverflow.com/q/3643313
https://stackoverflow.com/a/3643519
<p>You can use the <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="noreferrer">ConvertExtension</a> to export just that one file from the first repository into a new temporary repository, then use <code>hg pull -f</code> to import the new repository into the target repository.</p> <p>Create a filema...
<p>You can use the <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="noreferrer">ConvertExtension</a> to export just that one file from the first repository into a new temporary repository, then use <code>hg pull -f</code> to import the new repository into the target repository.</p> <p>Create a filema...
802
mercurial
<h1>Mercurial: copying ONE file and its history to another repository</h1> <p>I'm wondering if I can copy one file and its history from one repository to another, without having to import the <em>whole</em> other repository.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,895
mercurial
# Mercurial: copying ONE file and its history to another repository I'm wondering if I can copy one file and its history from one repository to another, without having to import the *whole* other repository.
You can use the [ConvertExtension](https://www.mercurial-scm.org/wiki/ConvertExtension) to export just that one file from the first repository into a new temporary repository, then use `hg pull -f` to import the new repository into the target repository. Create a filemap for the ConvertExtension with the single line: ...
2760810
Mercurial: Creating a diff of two commits
39
2010-05-03 19:58:09
<p>Is there a way to get the changes of two commits with mercurial? The second commit is not directly after the first one, there are some other ones between them.</p> <p>I tried</p> <pre><code>hg diff [some params] --change xxxxx --change yyyyy &gt; file.patch </code></pre> <p>but that only includes the last changes...
29,468
175,093
2016-12-16 10:39:15
2,895,094
59
2010-05-24 06:12:58
348,704
2013-06-03 18:29:42
https://stackoverflow.com/q/2760810
https://stackoverflow.com/a/2895094
<p>I came upon this page while trying to figure this very thing out. I found my solution via <code>hg help diff</code> .</p> <p><code>hg diff -r &lt;rev&gt; -r &lt;rev&gt;</code> worked for my needs (diffing between two tags)</p>
<p>I came upon this page while trying to figure this very thing out. I found my solution via <code>hg help diff</code> .</p> <p><code>hg diff -r &lt;rev&gt; -r &lt;rev&gt;</code> worked for my needs (diffing between two tags)</p>
606, 802
diff, mercurial
<h1>Mercurial: Creating a diff of two commits</h1> <p>Is there a way to get the changes of two commits with mercurial? The second commit is not directly after the first one, there are some other ones between them.</p> <p>I tried</p> <pre><code>hg diff [some params] --change xxxxx --change yyyyy &gt; file.patch </code...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,896
mercurial
# Mercurial: Creating a diff of two commits Is there a way to get the changes of two commits with mercurial? The second commit is not directly after the first one, there are some other ones between them. I tried ``` hg diff [some params] --change xxxxx --change yyyyy > file.patch ``` but that only includes the last...
I came upon this page while trying to figure this very thing out. I found my solution via `hg help diff` . `hg diff -r <rev> -r <rev>` worked for my needs (diffing between two tags)
12070220
Mercurial - cannot commit merge with missing files error
37
2012-08-22 09:33:57
<p>I have done a 'hg merge' however when I attempt to do a 'hg commit -m "my msg.." I get the following error message :</p> <pre><code>abort: cannot commit merge with missing files </code></pre> <p>Can anyone explain how to fix this to allow the commit go through?</p>
18,424
218,725
2017-12-05 13:02:12
12,071,002
58
2012-08-22 10:19:13
34,088
2012-09-21 12:28:37
https://stackoverflow.com/q/12070220
https://stackoverflow.com/a/12071002
<p>Try <code>hg status</code> and look for files in state <code>!</code> (missing).</p> <p>The cause is that one of the files which is part of the merge has been deleted. Undelete the file and try again.</p>
<p>Try <code>hg status</code> and look for files in state <code>!</code> (missing).</p> <p>The cause is that one of the files which is part of the merge has been deleted. Undelete the file and try again.</p>
802, 3346
dvcs, mercurial
<h1>Mercurial - cannot commit merge with missing files error</h1> <p>I have done a 'hg merge' however when I attempt to do a 'hg commit -m "my msg.." I get the following error message :</p> <pre><code>abort: cannot commit merge with missing files </code></pre> <p>Can anyone explain how to fix this to allow the commit...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,897
mercurial
# Mercurial - cannot commit merge with missing files error I have done a 'hg merge' however when I attempt to do a 'hg commit -m "my msg.." I get the following error message : ``` abort: cannot commit merge with missing files ``` Can anyone explain how to fix this to allow the commit go through?
Try `hg status` and look for files in state `!` (missing). The cause is that one of the files which is part of the merge has been deleted. Undelete the file and try again.
8995598
Can I mark a branch as 'not going to push'?
35
2012-01-24 23:04:39
<p>I use named branches in Mercurial.</p> <p>In doing so I have created one branch called playground where I can try out various wacky experiments. I never intend to merge this branch into any others and I never want to push it to our main repository.</p> <p>Since creating it, every time I do a push I am told I have...
8,079
5,056
2018-06-02 13:22:04
9,000,662
57
2012-01-25 09:54:53
110,204
2018-06-02 13:22:04
https://stackoverflow.com/q/8995598
https://stackoverflow.com/a/9000662
<p>Starting with Mercurial 2.1 (released in February 2012), you can mark your changesets <strong>secret</strong> to keep them from being pushed to another repository. You use the new <a href="https://www.mercurial-scm.org/wiki/Phases" rel="nofollow noreferrer"><code>hg phase</code> command</a> to do this:</p> <pre><co...
<p>Starting with Mercurial 2.1 (released in February 2012), you can mark your changesets <strong>secret</strong> to keep them from being pushed to another repository. You use the new <a href="https://www.mercurial-scm.org/wiki/Phases" rel="nofollow noreferrer"><code>hg phase</code> command</a> to do this:</p> <pre><co...
802, 1879, 3346, 4236
branch, dvcs, mercurial, push
<h1>Can I mark a branch as 'not going to push'?</h1> <p>I use named branches in Mercurial.</p> <p>In doing so I have created one branch called playground where I can try out various wacky experiments. I never intend to merge this branch into any others and I never want to push it to our main repository.</p> <p>Since...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,899
mercurial
# Can I mark a branch as 'not going to push'? I use named branches in Mercurial. In doing so I have created one branch called playground where I can try out various wacky experiments. I never intend to merge this branch into any others and I never want to push it to our main repository. Since creating it, every time...
Starting with Mercurial 2.1 (released in February 2012), you can mark your changesets **secret** to keep them from being pushed to another repository. You use the new [`hg phase` command](https://www.mercurial-scm.org/wiki/Phases) to do this: ``` $ hg phase --force --secret . ``` This mark the current working directo...
4061666
Switching between Mercurial branches
42
2010-10-31 03:04:25
<p>If I look at <a href="https://www.mercurial-scm.org/wiki/NamedBranches" rel="nofollow noreferrer">Mercurial's site</a>, it seems to tell me to use <code>update -C</code> to switch between branches. Another <a href="https://stackoverflow.com/questions/2159623/how-can-i-switch-to-a-tag-branch-in-hg">Stack Overflow</a>...
29,376
257,583
2018-02-22 10:19:27
4,061,675
56
2010-10-31 03:09:20
19,465
2014-10-18 18:03:22
https://stackoverflow.com/q/4061666
https://stackoverflow.com/a/4061675
<p><code>hg checkout</code> and <code>hg update</code> are aliases for each other, so can be used interchangeably. From the help for <code>hg update</code>:</p> <pre><code>hg update [-c] [-C] [-d DATE] [[-r] REV] aliases: up, checkout, co update working directory (or switch revisions) </code></pre> <p><code>-C</co...
<p><code>hg checkout</code> and <code>hg update</code> are aliases for each other, so can be used interchangeably. From the help for <code>hg update</code>:</p> <pre><code>hg update [-c] [-C] [-d DATE] [[-r] REV] aliases: up, checkout, co update working directory (or switch revisions) </code></pre> <p><code>-C</co...
456, 802, 1879
branch, mercurial, version-control
<h1>Switching between Mercurial branches</h1> <p>If I look at <a href="https://www.mercurial-scm.org/wiki/NamedBranches" rel="nofollow noreferrer">Mercurial's site</a>, it seems to tell me to use <code>update -C</code> to switch between branches. Another <a href="https://stackoverflow.com/questions/2159623/how-can-i-sw...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,900
mercurial
# Switching between Mercurial branches If I look at [Mercurial's site](https://www.mercurial-scm.org/wiki/NamedBranches), it seems to tell me to use `update -C` to switch between branches. Another [Stack Overflow](https://stackoverflow.com/questions/2159623/how-can-i-switch-to-a-tag-branch-in-hg) answer says to use `c...
`hg checkout` and `hg update` are aliases for each other, so can be used interchangeably. From the help for `hg update`: ``` hg update [-c] [-C] [-d DATE] [[-r] REV] aliases: up, checkout, co update working directory (or switch revisions) ``` `-C` or `--clean` option is used to throw away uncommitted changes when s...
257767
Can I split a Mercurial repository?
56
2008-11-03 02:01:40
<p>I have a largish Mercurial repository that I've decided would be better as several smaller repositories. Is there a way that I can split the repository and have each piece retain its revision history?</p>
6,390
207
2017-11-17 11:33:26
257,927
55
2008-11-03 04:14:54
8,992
2017-06-30 10:23:42
https://stackoverflow.com/q/257767
https://stackoverflow.com/a/257927
<p>The best way to do this is using the <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="nofollow noreferrer">'convert' extension</a>. You'll use mercurial and both source and destination type and then use a <code>--filemap</code> with entries like:</p> <pre><code>exclude path/you/do/not/want rename...
<p>The best way to do this is using the <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="nofollow noreferrer">'convert' extension</a>. You'll use mercurial and both source and destination type and then use a <code>--filemap</code> with entries like:</p> <pre><code>exclude path/you/do/not/want rename...
456, 802
mercurial, version-control
<h1>Can I split a Mercurial repository?</h1> <p>I have a largish Mercurial repository that I've decided would be better as several smaller repositories. Is there a way that I can split the repository and have each piece retain its revision history?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,901
mercurial
# Can I split a Mercurial repository? I have a largish Mercurial repository that I've decided would be better as several smaller repositories. Is there a way that I can split the repository and have each piece retain its revision history?
The best way to do this is using the ['convert' extension](https://www.mercurial-scm.org/wiki/ConvertExtension). You'll use mercurial and both source and destination type and then use a `--filemap` with entries like: ``` exclude path/you/do/not/want rename path/you/do/want . ``` The rename is only necessary if you wa...
1235597
mercurial automatic push on every commit
44
2009-08-05 20:37:50
<p>Being very familiar with the subversion workflow and that fact that 99.9% of the time my computer is connected to the internet, I don't like doing 'hg ci' and 'hg push' separately. </p> <p>I remember bzr had a 'checkout' command that would bind subsequent 'commit' commands to automatically commit directly to the se...
10,408
55,246
2011-06-28 22:09:17
1,235,614
55
2009-08-05 20:40:38
13,498
2009-08-05 21:01:59
https://stackoverflow.com/q/1235597
https://stackoverflow.com/a/1235614
<p>You could add a <a href="http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html" rel="noreferrer">hook</a> to run push after a successful commit.</p> <p><strong>EDIT:</strong> I just tried it out and it seems to work fine. I added the following to the <code>.hg/hgrc</code> file of the repositor...
<p>You could add a <a href="http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html" rel="noreferrer">hook</a> to run push after a successful commit.</p> <p><strong>EDIT:</strong> I just tried it out and it seems to work fine. I added the following to the <code>.hg/hgrc</code> file of the repositor...
802, 1362
automation, mercurial
<h1>mercurial automatic push on every commit</h1> <p>Being very familiar with the subversion workflow and that fact that 99.9% of the time my computer is connected to the internet, I don't like doing 'hg ci' and 'hg push' separately. </p> <p>I remember bzr had a 'checkout' command that would bind subsequent 'commit' c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,902
mercurial
# mercurial automatic push on every commit Being very familiar with the subversion workflow and that fact that 99.9% of the time my computer is connected to the internet, I don't like doing 'hg ci' and 'hg push' separately. I remember bzr had a 'checkout' command that would bind subsequent 'commit' commands to automa...
You could add a [hook](http://hgbook.red-bean.com/read/handling-repository-events-with-hooks.html) to run push after a successful commit. **EDIT:** I just tried it out and it seems to work fine. I added the following to the `.hg/hgrc` file of the repository I wanted to activate automatic pushing for: ``` [hooks] comm...
2661615
How do I unadd a not yet committed file I have added?
42
2010-04-18 08:39:23
<p>I typed in hg add and I am brand new to mercurial and the result of this was a bunch of dll's exe's pdb's etc all got added Nothing's been committed yet and I basically want to undo the add. the documentation for hg forget is not very clear not sure if that is want I want How do I undo the add before the next commi...
16,080
11,100
2016-08-17 03:24:54
2,661,627
54
2010-04-18 08:44:56
291,550
2016-08-17 03:24:54
https://stackoverflow.com/q/2661615
https://stackoverflow.com/a/2661627
<p>Check out <a href="https://www.mercurial-scm.org/wiki/TipsAndTricks#Undo_an_.27.60hg_add.60.27" rel="noreferrer">this mercurial tip</a>. To cite the link - if you have accidentally added a file, the way to undo that (changing its status from A back to ?, or unknown) is hg revert. For example, if you just ran hg add ...
<p>Check out <a href="https://www.mercurial-scm.org/wiki/TipsAndTricks#Undo_an_.27.60hg_add.60.27" rel="noreferrer">this mercurial tip</a>. To cite the link - if you have accidentally added a file, the way to undo that (changing its status from A back to ?, or unknown) is hg revert. For example, if you just ran hg add ...
802
mercurial
<h1>How do I unadd a not yet committed file I have added?</h1> <p>I typed in hg add and I am brand new to mercurial and the result of this was a bunch of dll's exe's pdb's etc all got added Nothing's been committed yet and I basically want to undo the add. the documentation for hg forget is not very clear not sure if ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,903
mercurial
# How do I unadd a not yet committed file I have added? I typed in hg add and I am brand new to mercurial and the result of this was a bunch of dll's exe's pdb's etc all got added Nothing's been committed yet and I basically want to undo the add. the documentation for hg forget is not very clear not sure if that is wa...
Check out [this mercurial tip](https://www.mercurial-scm.org/wiki/TipsAndTricks#Undo_an_.27.60hg_add.60.27). To cite the link - if you have accidentally added a file, the way to undo that (changing its status from A back to ?, or unknown) is hg revert. For example, if you just ran hg add and realized that you do not wa...
11011981
How can I get the current mercurial changeset revision not the hash
40
2012-06-13 09:30:03
<p>I need to get the current mercurial changeset to return in a <strong>very simple webservice</strong>, just the incrementing revision number and not the hash. I know I can use</p> <pre><code> hg --cwd C:\repos\MyRepo parent </code></pre> <p>which will return me</p> <pre><code>changeset: 730:9d347e4a8d47 tag: ...
29,532
96,505
2012-06-13 15:59:48
11,013,724
54
2012-06-13 11:17:16
310,500
2012-06-13 15:59:48
https://stackoverflow.com/q/11011981
https://stackoverflow.com/a/11013724
<p>You can show the local revision number of the working copy’s current parent using:</p> <pre><code>hg identify --num </code></pre> <p>Note that this outputs a <code>+</code> suffix when there are local changes. Add an <code>-r .</code> option to avoid this.</p> <p>You can use the <code>-r</code> option to get the ...
<p>You can show the local revision number of the working copy’s current parent using:</p> <pre><code>hg identify --num </code></pre> <p>Note that this outputs a <code>+</code> suffix when there are local changes. Add an <code>-r .</code> option to avoid this.</p> <p>You can use the <code>-r</code> option to get the ...
802
mercurial
<h1>How can I get the current mercurial changeset revision not the hash</h1> <p>I need to get the current mercurial changeset to return in a <strong>very simple webservice</strong>, just the incrementing revision number and not the hash. I know I can use</p> <pre><code> hg --cwd C:\repos\MyRepo parent </code></pre> <...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,904
mercurial
# How can I get the current mercurial changeset revision not the hash I need to get the current mercurial changeset to return in a **very simple webservice**, just the incrementing revision number and not the hash. I know I can use ``` hg --cwd C:\repos\MyRepo parent ``` which will return me ``` changeset: 730:9...
You can show the local revision number of the working copy’s current parent using: ``` hg identify --num ``` Note that this outputs a `+` suffix when there are local changes. Add an `-r .` option to avoid this. You can use the `-r` option to get the local revision number for other revisions too. For example, to retr...
5186976
Merging Mercurial branches from separate repositories
30
2011-03-03 21:45:37
<p>I'm trying to figure out how to merge branches from a separate repo into the current.</p> <p>I have the following:</p> <p>PJT1 - contains branches default and foodog</p> <p>PJT2 - contains branch default</p> <p>from PJT2, I do the following:</p> <pre><code>$ hg fetch -y ../PJT1 -r foodog -m "this is a test" </c...
37,546
145,129
2015-03-24 11:38:51
5,187,090
54
2011-03-03 21:56:21
8,992
2011-03-03 21:56:21
https://stackoverflow.com/q/5186976
https://stackoverflow.com/a/5187090
<p>You need to merge, but keep in mind changes on branch foodog will always be on foodog -- branches never go away but they can be hidden. This sequence of commands is as close as you'll get to what you're asking:</p> <pre><code>cd PJT2 hg update default # just in case you were somewhere else hg pull ../PJT1 -r foodo...
<p>You need to merge, but keep in mind changes on branch foodog will always be on foodog -- branches never go away but they can be hidden. This sequence of commands is as close as you'll get to what you're asking:</p> <pre><code>cd PJT2 hg update default # just in case you were somewhere else hg pull ../PJT1 -r foodo...
802, 53847
branching-and-merging, mercurial
<h1>Merging Mercurial branches from separate repositories</h1> <p>I'm trying to figure out how to merge branches from a separate repo into the current.</p> <p>I have the following:</p> <p>PJT1 - contains branches default and foodog</p> <p>PJT2 - contains branch default</p> <p>from PJT2, I do the following:</p> <pr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,905
mercurial
# Merging Mercurial branches from separate repositories I'm trying to figure out how to merge branches from a separate repo into the current. I have the following: PJT1 - contains branches default and foodog PJT2 - contains branch default from PJT2, I do the following: ``` $ hg fetch -y ../PJT1 -r foodog -m "this...
You need to merge, but keep in mind changes on branch foodog will always be on foodog -- branches never go away but they can be hidden. This sequence of commands is as close as you'll get to what you're asking: ``` cd PJT2 hg update default # just in case you were somewhere else hg pull ../PJT1 -r foodog # that gets ...
920355
How do I clone a sub-folder of a repository in Mercurial?
64
2009-05-28 11:18:47
<p>I have a Mercurial repository containing a handful of related projects. I want to branch just one of these projects to work on it elsewhere.</p> <p>Is cloning just part of a repository possible, and is that the right way to achieve this?</p>
21,843
11,828
2019-08-11 06:58:24
921,521
53
2009-05-28 15:33:19
110,204
2017-06-30 10:10:34
https://stackoverflow.com/q/920355
https://stackoverflow.com/a/921521
<p>What you want is a <a href="https://www.mercurial-scm.org/wiki/PartialClone" rel="nofollow noreferrer"><strong>narrow</strong> or <strong>partial</strong> clone</a>, but this is unfortunately not yet supported.</p> <p>If you already have a big repository and you realize that it would make sense to split it into sev...
<p>What you want is a <a href="https://www.mercurial-scm.org/wiki/PartialClone" rel="nofollow noreferrer"><strong>narrow</strong> or <strong>partial</strong> clone</a>, but this is unfortunately not yet supported.</p> <p>If you already have a big repository and you realize that it would make sense to split it into sev...
802, 3050, 3346
clone, dvcs, mercurial
<h1>How do I clone a sub-folder of a repository in Mercurial?</h1> <p>I have a Mercurial repository containing a handful of related projects. I want to branch just one of these projects to work on it elsewhere.</p> <p>Is cloning just part of a repository possible, and is that the right way to achieve this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,906
mercurial
# How do I clone a sub-folder of a repository in Mercurial? I have a Mercurial repository containing a handful of related projects. I want to branch just one of these projects to work on it elsewhere. Is cloning just part of a repository possible, and is that the right way to achieve this?
What you want is a [**narrow** or **partial** clone](https://www.mercurial-scm.org/wiki/PartialClone), but this is unfortunately not yet supported. If you already have a big repository and you realize that it would make sense to split it into several smaller repositories, then you can use the [convert extension](https...
996562
hg local ignore
42
2009-06-15 14:54:37
<p>I could have sworn there was a way to keep a local ignore file in an hg repo, i.e. a file similar in function to .hgignore, but not checked into the repo. This could be used to ignore changes to an IDE project file if different IDEs are being used, for example. I'm having trouble finding how it's done. Does anyon...
8,705
26,819
2018-02-22 12:26:07
996,727
53
2009-06-15 15:21:55
26,819
2018-02-22 12:26:07
https://stackoverflow.com/q/996562
https://stackoverflow.com/a/996727
<p><a href="https://www.mercurial-scm.org/wiki/TipsAndTricks#Ignore_files_in_local_working_copy_only" rel="noreferrer">This</a> is what I was looking for.</p> <blockquote> <p>Add the following to the repo's .hg/hgrc:</p> <pre><code>[ui] ignore = /path/to/repo/.hg/hgignore </code></pre> <p>and create a new file...
<p><a href="https://www.mercurial-scm.org/wiki/TipsAndTricks#Ignore_files_in_local_working_copy_only" rel="noreferrer">This</a> is what I was looking for.</p> <blockquote> <p>Add the following to the repo's .hg/hgrc:</p> <pre><code>[ui] ignore = /path/to/repo/.hg/hgignore </code></pre> <p>and create a new file...
456, 802, 3346, 31419
dvcs, hgignore, mercurial, version-control
<h1>hg local ignore</h1> <p>I could have sworn there was a way to keep a local ignore file in an hg repo, i.e. a file similar in function to .hgignore, but not checked into the repo. This could be used to ignore changes to an IDE project file if different IDEs are being used, for example. I'm having trouble finding h...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,907
mercurial
# hg local ignore I could have sworn there was a way to keep a local ignore file in an hg repo, i.e. a file similar in function to .hgignore, but not checked into the repo. This could be used to ignore changes to an IDE project file if different IDEs are being used, for example. I'm having trouble finding how it's don...
[This](https://www.mercurial-scm.org/wiki/TipsAndTricks#Ignore_files_in_local_working_copy_only) is what I was looking for. > Add the following to the repo's .hg/hgrc: > > ``` > [ui] > ignore = /path/to/repo/.hg/hgignore > ``` > > and create a new file .hg/hgignore beside it. This new file will be > untracked, but wor...
884545
Is there an ignore-on-commit option in mercurial?
41
2009-05-19 19:18:27
<p>Is there any way to ignore changes to some files on a commit with mercurial? </p> <p>I've got a specific situation where we have a default oracle tnsnames.ora file that points to 127.0.0.1, but some developers will modify it to point to other systems, but we don't want to change the default file.</p> <p>In subvers...
14,570
5,932
2009-05-31 15:19:26
896,021
53
2009-05-22 01:16:36
110,843
2009-05-22 01:16:36
https://stackoverflow.com/q/884545
https://stackoverflow.com/a/896021
<p>If the files you want to omit from the "hg commit" command are already "tracked", you should use the -X option. The pattern passed to -X is pretty flexible, making it possible to run for example:</p> <pre><code>% hg stat A etc/foo.conf M src/bar.c M lib/libbar/loader.c % hg commit -X '**.conf' </code></pre> <p>to...
<p>If the files you want to omit from the "hg commit" command are already "tracked", you should use the -X option. The pattern passed to -X is pretty flexible, making it possible to run for example:</p> <pre><code>% hg stat A etc/foo.conf M src/bar.c M lib/libbar/loader.c % hg commit -X '**.conf' </code></pre> <p>to...
802, 31419
hgignore, mercurial
<h1>Is there an ignore-on-commit option in mercurial?</h1> <p>Is there any way to ignore changes to some files on a commit with mercurial? </p> <p>I've got a specific situation where we have a default oracle tnsnames.ora file that points to 127.0.0.1, but some developers will modify it to point to other systems, but w...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,908
mercurial
# Is there an ignore-on-commit option in mercurial? Is there any way to ignore changes to some files on a commit with mercurial? I've got a specific situation where we have a default oracle tnsnames.ora file that points to 127.0.0.1, but some developers will modify it to point to other systems, but we don't want to c...
If the files you want to omit from the "hg commit" command are already "tracked", you should use the -X option. The pattern passed to -X is pretty flexible, making it possible to run for example: ``` % hg stat A etc/foo.conf M src/bar.c M lib/libbar/loader.c % hg commit -X '**.conf' ``` to avoid committing any file w...
3196556
Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system
36
2010-07-07 15:57:47
<p>Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system. Say I have a repository in <code>C:\MyProject\</code> and I want to create a clone in <code>G:\Version Control\MyProject\</code> - what would the command line be?</p> <p>Thanks </p>
32,538
179,064
2010-07-07 16:09:31
3,196,680
53
2010-07-07 16:09:31
75,188
2010-07-07 16:09:31
https://stackoverflow.com/q/3196556
https://stackoverflow.com/a/3196680
<p><code>hg help</code> is your friend. <code>hg help clone</code> yields:</p> <blockquote> <p>hg clone [OPTION]... SOURCE [DEST]</p> </blockquote> <p>So, for this case it should be something like:</p> <pre><code>hg clone C:\MyProject "G:\Version Control\MyProject" </code></pre>
<p><code>hg help</code> is your friend. <code>hg help clone</code> yields:</p> <blockquote> <p>hg clone [OPTION]... SOURCE [DEST]</p> </blockquote> <p>So, for this case it should be something like:</p> <pre><code>hg clone C:\MyProject "G:\Version Control\MyProject" </code></pre>
802, 3050
clone, mercurial
<h1>Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system</h1> <p>Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system. Say I have a repository in <code>C:\MyProject\</code> and I want to create a clone in <code>G:\Version Control\MyProject\...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,909
mercurial
# Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system Whats the Mercurial hg clone syntax to clone a repository to a folder on a local file system. Say I have a repository in `C:\MyProject\` and I want to create a clone in `G:\Version Control\MyProject\` - what would the comman...
`hg help` is your friend. `hg help clone` yields: > hg clone [OPTION]... SOURCE [DEST] So, for this case it should be something like: ``` hg clone C:\MyProject "G:\Version Control\MyProject" ```
6126678
How to list commiters sorted by number of commits (commit count)?
35
2011-05-25 15:10:00
<p>In mercurial, how do you list commiters sorted by number of commits (commit count).</p> <p>Using git, you can do something like this :</p> <pre><code>git shortlog -ns </code></pre> <p>What is the equivalent command for mercurial ?</p>
8,489
3,673
2018-01-16 14:03:14
6,127,577
53
2011-05-25 16:15:42
63,147
2011-05-25 16:22:06
https://stackoverflow.com/q/6126678
https://stackoverflow.com/a/6127577
<p>There is no pure Mercurial solution, but you can do something like:</p> <p><code>hg log --template "{author|person}\n" | sort | uniq -c | sort -nr</code></p> <p>If you want to be able to type <code>hg shortlog</code>, you can add the following to your <code>.hgrc</code> or <code>mercurial.ini</code>:</p> <pre><co...
<p>There is no pure Mercurial solution, but you can do something like:</p> <p><code>hg log --template "{author|person}\n" | sort | uniq -c | sort -nr</code></p> <p>If you want to be able to type <code>hg shortlog</code>, you can add the following to your <code>.hgrc</code> or <code>mercurial.ini</code>:</p> <pre><co...
802
mercurial
<h1>How to list commiters sorted by number of commits (commit count)?</h1> <p>In mercurial, how do you list commiters sorted by number of commits (commit count).</p> <p>Using git, you can do something like this :</p> <pre><code>git shortlog -ns </code></pre> <p>What is the equivalent command for mercurial ?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,910
mercurial
# How to list commiters sorted by number of commits (commit count)? In mercurial, how do you list commiters sorted by number of commits (commit count). Using git, you can do something like this : ``` git shortlog -ns ``` What is the equivalent command for mercurial ?
There is no pure Mercurial solution, but you can do something like: `hg log --template "{author|person}\n" | sort | uniq -c | sort -nr` If you want to be able to type `hg shortlog`, you can add the following to your `.hgrc` or `mercurial.ini`: ``` [alias] shortlog = !hg log --template "{author|person}\n" | sort | un...
5505463
How do you find the parent of a named mercurial branch?
34
2011-03-31 19:48:03
<p>At some point in time you have a mercurial named branch, let's call it, default, and you create a named branch from default, let's call it, foo, and you make some commits on foo. That work kind of looks like this:</p> <pre><code>hg update default hg branch foo hg commit -m "created branch foo" # work, work hg comm...
21,761
27,729
2017-05-24 10:31:39
5,507,460
53
2011-03-31 23:10:36
27,729
2011-03-31 23:10:36
https://stackoverflow.com/q/5505463
https://stackoverflow.com/a/5507460
<p>Thanks for the revset examples. I fiddled around and found this solution that I kind of like:</p> <pre><code>hg log -r "parents(min(branch(foo)))" </code></pre> <p>which will print the revision that the first commit on the foo branch was based on. You can look for the branch (or lack thereof indicating the defau...
<p>Thanks for the revset examples. I fiddled around and found this solution that I kind of like:</p> <pre><code>hg log -r "parents(min(branch(foo)))" </code></pre> <p>which will print the revision that the first commit on the foo branch was based on. You can look for the branch (or lack thereof indicating the defau...
802, 1879
branch, mercurial
<h1>How do you find the parent of a named mercurial branch?</h1> <p>At some point in time you have a mercurial named branch, let's call it, default, and you create a named branch from default, let's call it, foo, and you make some commits on foo. That work kind of looks like this:</p> <pre><code>hg update default hg ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,911
mercurial
# How do you find the parent of a named mercurial branch? At some point in time you have a mercurial named branch, let's call it, default, and you create a named branch from default, let's call it, foo, and you make some commits on foo. That work kind of looks like this: ``` hg update default hg branch foo hg commit ...
Thanks for the revset examples. I fiddled around and found this solution that I kind of like: ``` hg log -r "parents(min(branch(foo)))" ``` which will print the revision that the first commit on the foo branch was based on. You can look for the branch (or lack thereof indicating the default branch) in that changeset ...
3597206
Retrieve old version of a file without changing working copy parent
34
2010-08-30 00:44:06
<p>How do you get a copy of an earlier revision of a file in Mercurial without making that the new default working copy of the file in your workspace?</p> <p>I've found the <code>hg revert</code> command and I think it does what I want but I'm not sure.</p> <p>I need to get a copy of an earlier revision of my code to...
11,944
252,422
2012-03-30 12:23:52
3,598,203
52
2010-08-30 06:03:48
110,204
2010-08-31 21:48:44
https://stackoverflow.com/q/3597206
https://stackoverflow.com/a/3598203
<p>The <a href="http://www.selenic.com/mercurial/hg.1.html#cat" rel="noreferrer">cat command</a> can be used to retrieve any revision of a file:</p> <pre><code>$ hg cat -r 10 myfile.pls </code></pre> <p>You can redirect the output to another file with</p> <pre><code>$ hg cat -r 10 myfile.pls &gt; old.pls </code></pr...
<p>The <a href="http://www.selenic.com/mercurial/hg.1.html#cat" rel="noreferrer">cat command</a> can be used to retrieve any revision of a file:</p> <pre><code>$ hg cat -r 10 myfile.pls </code></pre> <p>You can redirect the output to another file with</p> <pre><code>$ hg cat -r 10 myfile.pls &gt; old.pls </code></pr...
456, 802, 3346, 12309
dvcs, mercurial, revert, version-control
<h1>Retrieve old version of a file without changing working copy parent</h1> <p>How do you get a copy of an earlier revision of a file in Mercurial without making that the new default working copy of the file in your workspace?</p> <p>I've found the <code>hg revert</code> command and I think it does what I want but I'...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,912
mercurial
# Retrieve old version of a file without changing working copy parent How do you get a copy of an earlier revision of a file in Mercurial without making that the new default working copy of the file in your workspace? I've found the `hg revert` command and I think it does what I want but I'm not sure. I need to get ...
The [cat command](http://www.selenic.com/mercurial/hg.1.html#cat) can be used to retrieve any revision of a file: ``` $ hg cat -r 10 myfile.pls ``` You can redirect the output to another file with ``` $ hg cat -r 10 myfile.pls > old.pls ``` or by using the `--output` flag. If you need to do this for several files, ...
3765208
Undo an hg push (backout?)
41
2010-09-21 23:25:27
<p>I made a big oops, and could use some help undoing it.</p> <p>We have two repositories-a fairly stable repository, and a repository we're working on changes in. I just made a defect fix in our stable repository, and was moving it up to the working repository. I pulled from the stable repository, merged, then acci...
41,262
340,725
2018-09-28 12:41:46
3,765,589
51
2010-09-22 00:57:49
62,479
2010-09-22 14:07:08
https://stackoverflow.com/q/3765208
https://stackoverflow.com/a/3765589
<p><code>hg rollback</code> reverts the last transaction, so you'd be left with unfinished merge, which you have to use <code>hg update -C</code> to get out.</p> <p>If you don't want *b (you have it in another clone), then enable the built-in MQ extension and run <code>hg strip -r &lt;*b&gt;</code>. It will get rid of...
<p><code>hg rollback</code> reverts the last transaction, so you'd be left with unfinished merge, which you have to use <code>hg update -C</code> to get out.</p> <p>If you don't want *b (you have it in another clone), then enable the built-in MQ extension and run <code>hg strip -r &lt;*b&gt;</code>. It will get rid of...
717, 802, 8122
mercurial, merge, tortoisehg
<h1>Undo an hg push (backout?)</h1> <p>I made a big oops, and could use some help undoing it.</p> <p>We have two repositories-a fairly stable repository, and a repository we're working on changes in. I just made a defect fix in our stable repository, and was moving it up to the working repository. I pulled from the ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,913
mercurial
# Undo an hg push (backout?) I made a big oops, and could use some help undoing it. We have two repositories-a fairly stable repository, and a repository we're working on changes in. I just made a defect fix in our stable repository, and was moving it up to the working repository. I pulled from the stable repository,...
`hg rollback` reverts the last transaction, so you'd be left with unfinished merge, which you have to use `hg update -C` to get out. If you don't want *b (you have it in another clone), then enable the built-in MQ extension and run `hg strip -r <*b>`. It will get rid of *b and *merge. By default it saves a backup in c...
4394273
What's the difference between update and pull?
38
2010-12-09 02:17:47
<p>Can someone clarify what's the exact difference between <em>update</em> and <em>pull</em> commands?</p> <p>Thanks.</p>
32,413
504,715
2020-03-17 16:46:48
4,394,287
51
2010-12-09 02:20:36
432,745
2014-04-14 17:50:00
https://stackoverflow.com/q/4394273
https://stackoverflow.com/a/4394287
<p>hg update : <a href="http://www.selenic.com/mercurial/hg.1.html#update" rel="noreferrer">http://www.selenic.com/mercurial/hg.1.html#update</a></p> <ul> <li>Update the repository's working directory (the "working copy") to the specified revision of the repository</li> </ul> <p>hg pull : <a href="http://www.selenic....
<p>hg update : <a href="http://www.selenic.com/mercurial/hg.1.html#update" rel="noreferrer">http://www.selenic.com/mercurial/hg.1.html#update</a></p> <ul> <li>Update the repository's working directory (the "working copy") to the specified revision of the repository</li> </ul> <p>hg pull : <a href="http://www.selenic....
456, 802
mercurial, version-control
<h1>What's the difference between update and pull?</h1> <p>Can someone clarify what's the exact difference between <em>update</em> and <em>pull</em> commands?</p> <p>Thanks.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,914
mercurial
# What's the difference between update and pull? Can someone clarify what's the exact difference between *update* and *pull* commands? Thanks.
hg update : <http://www.selenic.com/mercurial/hg.1.html#update> - Update the repository's working directory (the "working copy") to the specified revision of the repository hg pull : <http://www.selenic.com/mercurial/hg.1.html#pull> - Allows you to bring changes from a remote repository So when you do an hg pull, y...
3068627
Mercurial client error 255 and HTTP error 404 when attempting to push large files to server
30
2010-06-18 09:48:37
<h1>Problem:</h1> <p>19/06/10 Update: More evidence problem is server-side. Receiving this error on Windows 7 command line (see below for full traceback):</p> <pre><code>URLError: &lt;urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host&gt; abort: error: An existing connection...
23,912
370,057
2021-09-19 06:22:05
3,079,399
51
2010-06-20 13:34:53
371,533
2010-06-21 08:37:18
https://stackoverflow.com/q/3068627
https://stackoverflow.com/a/3079399
<p>Went through the same pain points... </p> <p>With the default settings on the IIS server, you will not be able to push large repositories to the server, as IIS has a default maximum request length of only 4 MB, and a timeout for CGI scripts of 15 min, making it impossible to upload large files. To enable the uploa...
<p>Went through the same pain points... </p> <p>With the default settings on the IIS server, you will not be able to push large repositories to the server, as IIS has a default maximum request length of only 4 MB, and a timeout for CGI scripts of 15 min, making it impossible to upload large files. To enable the uploa...
802, 4236, 5310, 35311, 56150
file, iis-7.5, machg, mercurial, push
<h1>Mercurial client error 255 and HTTP error 404 when attempting to push large files to server</h1> <h1>Problem:</h1> <p>19/06/10 Update: More evidence problem is server-side. Receiving this error on Windows 7 command line (see below for full traceback):</p> <pre><code>URLError: &lt;urlopen error [Errno 10054] An ex...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,915
mercurial
# Mercurial client error 255 and HTTP error 404 when attempting to push large files to server # Problem: 19/06/10 Update: More evidence problem is server-side. Receiving this error on Windows 7 command line (see below for full traceback): ``` URLError: <urlopen error [Errno 10054] An existing connection was forcibly...
Went through the same pain points... With the default settings on the IIS server, you will not be able to push large repositories to the server, as IIS has a default maximum request length of only 4 MB, and a timeout for CGI scripts of 15 min, making it impossible to upload large files. To enable the uploading of larg...
3068549
How to catch-up named mercurial branch from default branch without merging the two into one?
43
2010-06-18 09:34:10
<p>I have two branches in mercurial..</p> <pre><code>default named |r1 |r2 |r3 -------- named branch created here. | |r4 | |r5 | r6 | | |r7 | | -----------&gt; | r8 How do I achieve this catch-up? | | </code></pre> <p>I want to update the na...
11,242
16,177
2010-06-18 09:57:37
3,068,657
50
2010-06-18 09:54:44
148,532
2010-06-18 09:54:44
https://stackoverflow.com/q/3068549
https://stackoverflow.com/a/3068657
<p><code>hg merge default</code> from your named branch.</p>
<p><code>hg merge default</code> from your named branch.</p>
802, 1879
branch, mercurial
<h1>How to catch-up named mercurial branch from default branch without merging the two into one?</h1> <p>I have two branches in mercurial..</p> <pre><code>default named |r1 |r2 |r3 -------- named branch created here. | |r4 | |r5 | r6 | | |r7 | | ----------...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,916
mercurial
# How to catch-up named mercurial branch from default branch without merging the two into one? I have two branches in mercurial.. ``` default named |r1 |r2 |r3 -------- named branch created here. | |r4 | |r5 | r6 | | |r7 | | -----------> | r8 How do I ...
`hg merge default` from your named branch.
3214717
How can I import a mercurial repo (including history) into another mercurial repo as a subdirectory, without using subrepos?
41
2010-07-09 16:40:22
<p>This sounds kind of complex, so let me explain:</p> <p>Project_A has lived for some time within its own Mercurial repository. Project_A is now getting folded into a new super project, Super-Project_B. Super-Project_B also has a mercurial repository. We would prefer if Project_A were not a subrepo, but instead just...
8,331
8,368
2010-07-09 17:21:02
3,215,017
50
2010-07-09 17:21:02
8,992
2010-07-09 17:21:02
https://stackoverflow.com/q/3214717
https://stackoverflow.com/a/3215017
<p>Yeah. Use the convert extension to move projectA down one directory level:</p> <pre><code>hg convert --filemap filemap.txt projectA projectA-redone </code></pre> <p>where your <code>filemap.txt</code> has this line in it:</p> <pre><code>rename . projectA </code></pre> <p>(that dot might be a slash but I don't t...
<p>Yeah. Use the convert extension to move projectA down one directory level:</p> <pre><code>hg convert --filemap filemap.txt projectA projectA-redone </code></pre> <p>where your <code>filemap.txt</code> has this line in it:</p> <pre><code>rename . projectA </code></pre> <p>(that dot might be a slash but I don't t...
802
mercurial
<h1>How can I import a mercurial repo (including history) into another mercurial repo as a subdirectory, without using subrepos?</h1> <p>This sounds kind of complex, so let me explain:</p> <p>Project_A has lived for some time within its own Mercurial repository. Project_A is now getting folded into a new super project...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,917
mercurial
# How can I import a mercurial repo (including history) into another mercurial repo as a subdirectory, without using subrepos? This sounds kind of complex, so let me explain: Project_A has lived for some time within its own Mercurial repository. Project_A is now getting folded into a new super project, Super-Project_...
Yeah. Use the convert extension to move projectA down one directory level: ``` hg convert --filemap filemap.txt projectA projectA-redone ``` where your `filemap.txt` has this line in it: ``` rename . projectA ``` (that dot might be a slash but I don't think so). That will give you a new repo, projectA-redone, that...
4502297
How do you remove a Mercurial repository
44
2010-12-21 17:48:06
<p>I accidently put a Mercurial repository in the wrong place. How do I remove it? This is in Linux.</p>
22,170
404,409
2012-08-01 18:21:58
4,502,302
49
2010-12-21 17:49:01
85,360
2012-08-01 18:21:58
https://stackoverflow.com/q/4502297
https://stackoverflow.com/a/4502302
<p>Recursively remove the <code>.hg</code> directory? You can also just move it; they are portable, and the setup files inside of <code>.hg</code> contain no absolute paths that would break if placed elsewhere on the system.</p> <p>From the comments: <code>rm -r .hg</code></p>
<p>Recursively remove the <code>.hg</code> directory? You can also just move it; they are portable, and the setup files inside of <code>.hg</code> contain no absolute paths that would break if placed elsewhere on the system.</p> <p>From the comments: <code>rm -r .hg</code></p>
58, 802
linux, mercurial
<h1>How do you remove a Mercurial repository</h1> <p>I accidently put a Mercurial repository in the wrong place. How do I remove it? This is in Linux.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,918
mercurial
# How do you remove a Mercurial repository I accidently put a Mercurial repository in the wrong place. How do I remove it? This is in Linux.
Recursively remove the `.hg` directory? You can also just move it; they are portable, and the setup files inside of `.hg` contain no absolute paths that would break if placed elsewhere on the system. From the comments: `rm -r .hg`
6825355
How do I delete a remote bookmark in Mercurial?
32
2011-07-26 04:45:07
<p>I can delete remote branches in Git using <code>git push</code>. (See <a href="https://stackoverflow.com/questions/4159950/how-do-i-delete-remote-branch-in-git">How do I delete a remote branch in Git?</a>). But I can't do the equivalent using Mercurial bookmarks.</p> <p>I've tried <code>hg bookmark -d something</co...
13,372
617,159
2019-09-04 16:53:04
6,835,308
49
2011-07-26 19:17:53
63,147
2016-09-22 13:09:50
https://stackoverflow.com/q/6825355
https://stackoverflow.com/a/6835308
<p>To delete a bookmark from a remote server, you must have permission to push to the server. If you can push to it, then you can:</p> <pre><code>hg bookmark --delete &lt;bookmark name&gt; hg push --bookmark &lt;bookmark name&gt; </code></pre> <p>See the "<em>Working With Remote Repositories</em>" section of the <a ...
<p>To delete a bookmark from a remote server, you must have permission to push to the server. If you can push to it, then you can:</p> <pre><code>hg bookmark --delete &lt;bookmark name&gt; hg push --bookmark &lt;bookmark name&gt; </code></pre> <p>See the "<em>Working With Remote Repositories</em>" section of the <a ...
802
mercurial
<h1>How do I delete a remote bookmark in Mercurial?</h1> <p>I can delete remote branches in Git using <code>git push</code>. (See <a href="https://stackoverflow.com/questions/4159950/how-do-i-delete-remote-branch-in-git">How do I delete a remote branch in Git?</a>). But I can't do the equivalent using Mercurial bookmar...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,919
mercurial
# How do I delete a remote bookmark in Mercurial? I can delete remote branches in Git using `git push`. (See [How do I delete a remote branch in Git?](https://stackoverflow.com/questions/4159950/how-do-i-delete-remote-branch-in-git)). But I can't do the equivalent using Mercurial bookmarks. I've tried `hg bookmark -d...
To delete a bookmark from a remote server, you must have permission to push to the server. If you can push to it, then you can: ``` hg bookmark --delete <bookmark name> hg push --bookmark <bookmark name> ``` See the "*Working With Remote Repositories*" section of the [Mercurial BookmarksExtension wiki](http://mercuri...
10262306
How to point pip at a Mercurial branch?
31
2012-04-21 19:36:03
<p>I'm trying to install my application via pip to a virtualenv for testing.</p> <p>Works fine for installing the <code>default</code> or <code>tip</code> like so:</p> <pre><code>pip install -e hg+https://username@bitbucket.org/username/app_name#egg=app_name </code></pre> <p>But is there any way to point to a branch...
11,656
443,722
2017-03-21 22:00:10
10,470,015
48
2012-05-06 11:01:53
95,735
2017-03-21 22:00:10
https://stackoverflow.com/q/10262306
https://stackoverflow.com/a/10470015
<p>In official pip documentation in section <a href="https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support" rel="nofollow noreferrer">VCS Support</a>:</p> <blockquote> <p>Mercurial</p> <p>The supported schemes are: hg+http, hg+https, hg+static-http and hg+ssh:</p> <pre><code>-e hg+http://hg.myproj...
<p>In official pip documentation in section <a href="https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support" rel="nofollow noreferrer">VCS Support</a>:</p> <blockquote> <p>Mercurial</p> <p>The supported schemes are: hg+http, hg+https, hg+static-http and hg+ssh:</p> <pre><code>-e hg+http://hg.myproj...
16, 802, 5119
mercurial, pip, python
<h1>How to point pip at a Mercurial branch?</h1> <p>I'm trying to install my application via pip to a virtualenv for testing.</p> <p>Works fine for installing the <code>default</code> or <code>tip</code> like so:</p> <pre><code>pip install -e hg+https://username@bitbucket.org/username/app_name#egg=app_name </code></p...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,920
mercurial
# How to point pip at a Mercurial branch? I'm trying to install my application via pip to a virtualenv for testing. Works fine for installing the `default` or `tip` like so: ``` pip install -e hg+https://username@bitbucket.org/username/app_name#egg=app_name ``` But is there any way to point to a branch, rather than...
In official pip documentation in section [VCS Support](https://pip.pypa.io/en/latest/reference/pip_install/#vcs-support): > Mercurial > > The supported schemes are: hg+http, hg+https, hg+static-http and > hg+ssh: > > ``` > -e hg+http://hg.myproject.org/MyProject/#egg=MyProject > -e hg+https://hg.myproject.org/MyProjec...
1405604
Managing release branches in Mercurial
48
2009-09-10 14:28:08
<p>Recently I switched from SVN to Mercurial. Now I wonder how to realize my intended branching work flow in Mercurial according to good practice, hoping other developers understand what happens in the repository.</p> <p>This is the work flow:</p> <ol> <li>Usually I have a trunk/default branch where work on the curre...
7,681
151,299
2015-01-28 00:15:39
1,406,906
47
2009-09-10 18:23:42
13,498
2009-09-10 18:23:42
https://stackoverflow.com/q/1405604
https://stackoverflow.com/a/1406906
<p>Here's what I'd do:</p> <p>Make <code>default</code> your "mainline" branch. The tip of this branch is the "currently released to the public" version of your code. Critical bugfixes can be committed directly to this branch and merged into development branches.</p> <p>To start working on version 2.0, make a <code...
<p>Here's what I'd do:</p> <p>Make <code>default</code> your "mainline" branch. The tip of this branch is the "currently released to the public" version of your code. Critical bugfixes can be committed directly to this branch and merged into development branches.</p> <p>To start working on version 2.0, make a <code...
802, 1879
branch, mercurial
<h1>Managing release branches in Mercurial</h1> <p>Recently I switched from SVN to Mercurial. Now I wonder how to realize my intended branching work flow in Mercurial according to good practice, hoping other developers understand what happens in the repository.</p> <p>This is the work flow:</p> <ol> <li>Usually I hav...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,921
mercurial
# Managing release branches in Mercurial Recently I switched from SVN to Mercurial. Now I wonder how to realize my intended branching work flow in Mercurial according to good practice, hoping other developers understand what happens in the repository. This is the work flow: 1. Usually I have a trunk/default branch w...
Here's what I'd do: Make `default` your "mainline" branch. The tip of this branch is the "currently released to the public" version of your code. Critical bugfixes can be committed directly to this branch and merged into development branches. To start working on version 2.0, make a `2.0-dev` branch. Commit changes fo...
23122183
Can you close a Mercurial branch without updating to it first?
33
2014-04-16 23:46:29
<p>I am aware that you can close a Mercurial branch with:</p> <pre><code>hg update rev-number hg commit --close-branch -m "Closing branch." </code></pre> <p>However, some of the repositories I work with a rather large, and after discovering a loose branch from years ago that I want to close, updating to it first can ...
4,483
1,127,065
2020-11-10 18:26:11
23,122,570
47
2014-04-17 00:30:31
870,953
2014-04-18 00:15:37
https://stackoverflow.com/q/23122183
https://stackoverflow.com/a/23122570
<p>Yes you can, but this is not documented anywhere. I've used this technique for a long time, don't worry, it is safe.</p> <p>Instead of updating, you can issue the following commands</p> <pre><code>hg debugsetparent &lt;revision&gt; hg branch &lt;branchOfRevision&gt; </code></pre> <p>Note that the order is importa...
<p>Yes you can, but this is not documented anywhere. I've used this technique for a long time, don't worry, it is safe.</p> <p>Instead of updating, you can issue the following commands</p> <pre><code>hg debugsetparent &lt;revision&gt; hg branch &lt;branchOfRevision&gt; </code></pre> <p>Note that the order is importa...
802, 1879
branch, mercurial
<h1>Can you close a Mercurial branch without updating to it first?</h1> <p>I am aware that you can close a Mercurial branch with:</p> <pre><code>hg update rev-number hg commit --close-branch -m "Closing branch." </code></pre> <p>However, some of the repositories I work with a rather large, and after discovering a loo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,922
mercurial
# Can you close a Mercurial branch without updating to it first? I am aware that you can close a Mercurial branch with: ``` hg update rev-number hg commit --close-branch -m "Closing branch." ``` However, some of the repositories I work with a rather large, and after discovering a loose branch from years ago that I w...
Yes you can, but this is not documented anywhere. I've used this technique for a long time, don't worry, it is safe. Instead of updating, you can issue the following commands ``` hg debugsetparent <revision> hg branch <branchOfRevision> ``` Note that the order is important. This will make your repo think it is on th...
8132868
Mercurial: How to restore after rebase
30
2011-11-15 07:27:54
<p>I've accidentally pulled some changes from the main repo with --rebase parameter.</p> <p>How do I restore the original repository state from the backup which was created during the rebase?</p>
11,034
905,318
2012-11-12 06:30:29
8,133,527
47
2011-11-15 08:39:02
85,615
2011-11-15 08:39:02
https://stackoverflow.com/q/8132868
https://stackoverflow.com/a/8133527
<p><code>hg unbundle</code> is used to apply the backup file:</p> <pre><code>hg unbundle .hg/strip-backup/e64394fd5837-backup.hg </code></pre> <p>However, this does not remove the new changesets that have been created by the rebase; it is probably a good idea to call <code>hg unbundle</code> from a repo that does not...
<p><code>hg unbundle</code> is used to apply the backup file:</p> <pre><code>hg unbundle .hg/strip-backup/e64394fd5837-backup.hg </code></pre> <p>However, this does not remove the new changesets that have been created by the rebase; it is probably a good idea to call <code>hg unbundle</code> from a repo that does not...
493, 802, 5377, 8974
backup, mercurial, rebase, restore
<h1>Mercurial: How to restore after rebase</h1> <p>I've accidentally pulled some changes from the main repo with --rebase parameter.</p> <p>How do I restore the original repository state from the backup which was created during the rebase?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,923
mercurial
# Mercurial: How to restore after rebase I've accidentally pulled some changes from the main repo with --rebase parameter. How do I restore the original repository state from the backup which was created during the rebase?
`hg unbundle` is used to apply the backup file: ``` hg unbundle .hg/strip-backup/e64394fd5837-backup.hg ``` However, this does not remove the new changesets that have been created by the rebase; it is probably a good idea to call `hg unbundle` from a repo that does not have the rebased changesets (i.e. clone latest v...
6097578
Mercurial Diff Merge: What tool is this and how do I use it?
28
2011-05-23 13:04:46
<p>I am new to mercurial, I am quite familiar with TortoiseHG, but this is the first time I am managing a project in a headless linux environment. I do an <code>hg update</code> after a push, and I get this screen:</p> <p><img src="https://i.sstatic.net/WNHq4.png" alt="enter image description here"></p> <p>Help secti...
17,027
157,837
2017-05-18 08:22:09
6,097,728
47
2011-05-23 13:16:59
129,064
2011-05-23 13:16:59
https://stackoverflow.com/q/6097578
https://stackoverflow.com/a/6097728
<p>This is vimdiff. You can learn more about it by running <code>man vimdiff</code>.</p> <p>However, I would recommend using mercurial's internal:merge tool. It will perform the merge and, if a conflict occurs, insert conflict markers in the file and notify you that there was a conflict. You then open up the file, ...
<p>This is vimdiff. You can learn more about it by running <code>man vimdiff</code>.</p> <p>However, I would recommend using mercurial's internal:merge tool. It will perform the merge and, if a conflict occurs, insert conflict markers in the file and notify you that there was a conflict. You then open up the file, ...
58, 370, 606, 802, 5792
diff, linux, mercurial, version, vim
<h1>Mercurial Diff Merge: What tool is this and how do I use it?</h1> <p>I am new to mercurial, I am quite familiar with TortoiseHG, but this is the first time I am managing a project in a headless linux environment. I do an <code>hg update</code> after a push, and I get this screen:</p> <p><img src="https://i.sstatic...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,924
mercurial
# Mercurial Diff Merge: What tool is this and how do I use it? I am new to mercurial, I am quite familiar with TortoiseHG, but this is the first time I am managing a project in a headless linux environment. I do an `hg update` after a push, and I get this screen: ![enter image description here](https://i.sstatic.net/...
This is vimdiff. You can learn more about it by running `man vimdiff`. However, I would recommend using mercurial's internal:merge tool. It will perform the merge and, if a conflict occurs, insert conflict markers in the file and notify you that there was a conflict. You then open up the file, resolve the conflict, re...
7602222
What are the differences in the VisualStudio Add-ins for Mercurial?
54
2011-09-29 19:11:08
<p>I'm evaluating Visual Studio Add-ins for Mercurial. Currently, I've identified 3 potential candidates :</p> <ul> <li>VisualHg <a href="http://visualhg.codeplex.com" rel="nofollow noreferrer">http://visualhg.codeplex.com</a></li> <li>Mercurial Toolbar : <a href="http://mercurialtoolbar.codeplex.com" rel="nofollow no...
13,018
134,973
2021-01-14 15:31:32
7,602,670
46
2011-09-29 19:54:27
22,211
2011-09-29 19:59:52
https://stackoverflow.com/q/7602222
https://stackoverflow.com/a/7602670
<p>Well, let's compare the details of development:</p> <ul> <li>VisualHg's page says it's stable. The last version release was March of this year and the latest changesets in the source are from 1 week ago.</li> <li>HgSccPackage (better <a href="http://visualstudiogallery.msdn.microsoft.com/9bc074fa-9e1f-4ce2-a75d-b90...
<p>Well, let's compare the details of development:</p> <ul> <li>VisualHg's page says it's stable. The last version release was March of this year and the latest changesets in the source are from 1 week ago.</li> <li>HgSccPackage (better <a href="http://visualstudiogallery.msdn.microsoft.com/9bc074fa-9e1f-4ce2-a75d-b90...
802, 4144, 33953
mercurial, visual-studio, visual-studio-addins
<h1>What are the differences in the VisualStudio Add-ins for Mercurial?</h1> <p>I'm evaluating Visual Studio Add-ins for Mercurial. Currently, I've identified 3 potential candidates :</p> <ul> <li>VisualHg <a href="http://visualhg.codeplex.com" rel="nofollow noreferrer">http://visualhg.codeplex.com</a></li> <li>Mercur...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,925
mercurial
# What are the differences in the VisualStudio Add-ins for Mercurial? I'm evaluating Visual Studio Add-ins for Mercurial. Currently, I've identified 3 potential candidates : - VisualHg <http://visualhg.codeplex.com> - Mercurial Toolbar : <http://mercurialtoolbar.codeplex.com> - HgSccPackage : <http://www.newsupaplex....
Well, let's compare the details of development: - VisualHg's page says it's stable. The last version release was March of this year and the latest changesets in the source are from 1 week ago. - HgSccPackage (better [found here](http://visualstudiogallery.msdn.microsoft.com/9bc074fa-9e1f-4ce2-a75d-b90e65f7475a) than y...
2373559
Removing file from Mercurial MQ Patch
35
2010-03-03 17:39:27
<p>I have large MQ patch applied in Mercurial. What has happened is I have done qrefresh and included files in my patch that I do not want to include. Is there a way to remove the changes to these file from my patch with out manually editing it? In this case if I was just working without MQ, all I would have to do is h...
6,087
3,453
2014-02-13 10:12:53
2,928,963
46
2010-05-28 12:33:39
352,890
2014-02-13 10:12:53
https://stackoverflow.com/q/2373559
https://stackoverflow.com/a/2928963
<p>With the patch applied:</p> <pre><code>hg qrefresh -X [file1] -X [file2] ... -X [fileN] </code></pre> <p>Will take out file1 to fileN of the patch. After completing that, type <code>hg status</code> to verify that the files are now marked as modified, and therefore not part of the patch any longer .</p>
<p>With the patch applied:</p> <pre><code>hg qrefresh -X [file1] -X [file2] ... -X [fileN] </code></pre> <p>Will take out file1 to fileN of the patch. After completing that, type <code>hg status</code> to verify that the files are now marked as modified, and therefore not part of the patch any longer .</p>
802, 32068
mercurial, mercurial-queue
<h1>Removing file from Mercurial MQ Patch</h1> <p>I have large MQ patch applied in Mercurial. What has happened is I have done qrefresh and included files in my patch that I do not want to include. Is there a way to remove the changes to these file from my patch with out manually editing it? In this case if I was just ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,926
mercurial
# Removing file from Mercurial MQ Patch I have large MQ patch applied in Mercurial. What has happened is I have done qrefresh and included files in my patch that I do not want to include. Is there a way to remove the changes to these file from my patch with out manually editing it? In this case if I was just working w...
With the patch applied: ``` hg qrefresh -X [file1] -X [file2] ... -X [fileN] ``` Will take out file1 to fileN of the patch. After completing that, type `hg status` to verify that the files are now marked as modified, and therefore not part of the patch any longer .
310117
ignoring folders in mercurial
33
2008-11-21 20:37:35
<p><strong>Caveat:</strong> I try all the posibilities listed here: <a href="https://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial">How can I ignore everything under a folder in Mercurial</a>.<br> None works as I hope. </p> <p>I want to ignore every thing under the folder ...
22,650
1,356,709
2021-08-11 00:07:16
313,392
46
2008-11-24 04:10:38
8,992
2008-11-24 04:10:38
https://stackoverflow.com/q/310117
https://stackoverflow.com/a/313392
<p>Try it without the slash after the caret in the regexp version.</p> <pre><code>^test/ </code></pre> <p>Here's a test:</p> <pre><code>~$ mkdir hg-folder-ignore ~$ cd hg-folder-ignore ~/hg-folder-ignore$ echo '^test/' &gt; .hgignore ~/hg-folder-ignore$ hg init ~/hg-folder-ignore$ mkdir test ~/hg-folder-ignore$ touc...
<p>Try it without the slash after the caret in the regexp version.</p> <pre><code>^test/ </code></pre> <p>Here's a test:</p> <pre><code>~$ mkdir hg-folder-ignore ~$ cd hg-folder-ignore ~/hg-folder-ignore$ echo '^test/' &gt; .hgignore ~/hg-folder-ignore$ hg init ~/hg-folder-ignore$ mkdir test ~/hg-folder-ignore$ touc...
18, 802, 31419
hgignore, mercurial, regex
<h1>ignoring folders in mercurial</h1> <p><strong>Caveat:</strong> I try all the posibilities listed here: <a href="https://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial">How can I ignore everything under a folder in Mercurial</a>.<br> None works as I hope. </p> <p>I want ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,927
mercurial
# ignoring folders in mercurial **Caveat:** I try all the posibilities listed here: [How can I ignore everything under a folder in Mercurial](https://stackoverflow.com/questions/254002/how-can-i-ignore-everything-under-a-folder-in-mercurial). None works as I hope. I want to ignore every thing under the folder `test...
Try it without the slash after the caret in the regexp version. ``` ^test/ ``` Here's a test: ``` ~$ mkdir hg-folder-ignore ~$ cd hg-folder-ignore ~/hg-folder-ignore$ echo '^test/' > .hgignore ~/hg-folder-ignore$ hg init ~/hg-folder-ignore$ mkdir test ~/hg-folder-ignore$ touch test/ignoreme ~/hg-folder-ignore$ mkdir...
4363522
How can I label my build with revision number and not the GUID (in TeamCity)?
31
2010-12-06 05:33:33
<p>I am trying to do "continuous integration" with TeamCity. I would like to label my builds in a incremental way and the GUID provided by the VCS is not as usefull as a simple increasing number. I would like the number to actually match the revision in number in Mercurial.</p> <p>My state of affairs:</p> <p><img src...
12,162
4,694
2013-05-23 09:08:39
4,367,747
46
2010-12-06 15:07:52
8,992
2010-12-06 15:07:52
https://stackoverflow.com/q/4363522
https://stackoverflow.com/a/4367747
<p>As Lasse V. Karlsen mentioned those numerical revision numbers are local-clone specific and can be different for each clone. They're really not suitable for versioning -- you could reclone the same repo and get different revision numbers.</p> <p>At the very least include the node id also creating something like <c...
<p>As Lasse V. Karlsen mentioned those numerical revision numbers are local-clone specific and can be different for each clone. They're really not suitable for versioning -- you could reclone the same repo and get different revision numbers.</p> <p>At the very least include the node id also creating something like <c...
604, 802
mercurial, teamcity
<h1>How can I label my build with revision number and not the GUID (in TeamCity)?</h1> <p>I am trying to do "continuous integration" with TeamCity. I would like to label my builds in a incremental way and the GUID provided by the VCS is not as usefull as a simple increasing number. I would like the number to actually m...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,928
mercurial
# How can I label my build with revision number and not the GUID (in TeamCity)? I am trying to do "continuous integration" with TeamCity. I would like to label my builds in a incremental way and the GUID provided by the VCS is not as usefull as a simple increasing number. I would like the number to actually match the ...
As Lasse V. Karlsen mentioned those numerical revision numbers are local-clone specific and can be different for each clone. They're really not suitable for versioning -- you could reclone the same repo and get different revision numbers. At the very least include the node id also creating something like `0.0.12-6ec76...
3535676
How to rename a directory in Mercurial and continue to track all file changes
41
2010-08-21 00:03:47
<p>I decided to rename some directories in my home/hobby Python package (<code>doc</code> to <code>docs</code>, <code>test</code> to <code>tests</code>, <code>util</code> to <code>utils</code>) because, now that I've thought more about it, I think the new names are more appropriate. My general thinking now is that if c...
17,894
140,894
2013-07-02 09:40:53
3,535,731
45
2010-08-21 00:27:11
19,465
2010-08-21 00:43:01
https://stackoverflow.com/q/3535676
https://stackoverflow.com/a/3535731
<p>Since you've already renamed the directories, this is perfectly OK. (It would have saved you a manual step if you'd let Mercurial rename them for you: <code>hg rename doc docs</code>, etc. instead of doing it yourself then letting Mercurial know about it).</p> <p>If you don't have any other files to check in, the ...
<p>Since you've already renamed the directories, this is perfectly OK. (It would have saved you a manual step if you'd let Mercurial rename them for you: <code>hg rename doc docs</code>, etc. instead of doing it yourself then letting Mercurial know about it).</p> <p>If you don't have any other files to check in, the ...
16, 802
mercurial, python
<h1>How to rename a directory in Mercurial and continue to track all file changes</h1> <p>I decided to rename some directories in my home/hobby Python package (<code>doc</code> to <code>docs</code>, <code>test</code> to <code>tests</code>, <code>util</code> to <code>utils</code>) because, now that I've thought more abo...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,929
mercurial
# How to rename a directory in Mercurial and continue to track all file changes I decided to rename some directories in my home/hobby Python package (`doc` to `docs`, `test` to `tests`, `util` to `utils`) because, now that I've thought more about it, I think the new names are more appropriate. My general thinking now ...
Since you've already renamed the directories, this is perfectly OK. (It would have saved you a manual step if you'd let Mercurial rename them for you: `hg rename doc docs`, etc. instead of doing it yourself then letting Mercurial know about it). If you don't have any other files to check in, the `hg addremove` is supe...
14637476
How can I browse public repositories on Bitbucket?
31
2013-02-01 00:06:08
<p>I'm learning to use TortoiseHG and want to pull from someone else's repository to see what a real, working one looks like -- how often they branch and merge, how much code they lump into each commit.</p>
35,760
733,092
2021-06-28 08:16:53
14,637,762
45
2013-02-01 00:32:56
422,353
2013-02-01 00:32:56
https://stackoverflow.com/q/14637476
https://stackoverflow.com/a/14637762
<p>The amount of repositories must be quite large and I don't think there is a way to browse them.</p> <ol> <li><p>There is a search function at </p> <pre><code>https://bitbucket.org/repo/all </code></pre> <p>that you might use to look for repositories about a certain topic.</p></li> <li><p>The <a href="https://bitb...
<p>The amount of repositories must be quite large and I don't think there is a way to browse them.</p> <ol> <li><p>There is a search function at </p> <pre><code>https://bitbucket.org/repo/all </code></pre> <p>that you might use to look for repositories about a certain topic.</p></li> <li><p>The <a href="https://bitb...
8122, 8337
bitbucket, tortoisehg
<h1>How can I browse public repositories on Bitbucket?</h1> <p>I'm learning to use TortoiseHG and want to pull from someone else's repository to see what a real, working one looks like -- how often they branch and merge, how much code they lump into each commit.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,930
mercurial
# How can I browse public repositories on Bitbucket? I'm learning to use TortoiseHG and want to pull from someone else's repository to see what a real, working one looks like -- how often they branch and merge, how much code they lump into each commit.
The amount of repositories must be quite large and I don't think there is a way to browse them. 1. There is a search function at ``` https://bitbucket.org/repo/all ``` that you might use to look for repositories about a certain topic. 2. The [main page](https://bitbucket.org/) has a a few examples at the...
6223039
Push to multiple remote repositories from a single local repo in Mercurial
29
2011-06-03 04:44:27
<p>I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration.</p> <p>Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration.</p> <p>Is it possible to have 2 remote repositories for a single local repository? ...
7,141
120,243
2012-05-16 06:58:27
6,224,149
45
2011-06-03 07:20:48
4,596
2011-06-06 06:13:59
https://stackoverflow.com/q/6223039
https://stackoverflow.com/a/6224149
<p>You can set multiple remote repository aliases in the <code>[paths]</code> section of the repository configuration file. This file is in .hg/hgrc, and you would add paths like this</p> <pre><code>[paths] default = http://kilnhg.com/repo bitbucket = http://bitbucket.org/repo </code></pre> <p>Then you would run <cod...
<p>You can set multiple remote repository aliases in the <code>[paths]</code> section of the repository configuration file. This file is in .hg/hgrc, and you would add paths like this</p> <pre><code>[paths] default = http://kilnhg.com/repo bitbucket = http://bitbucket.org/repo </code></pre> <p>Then you would run <cod...
456, 802, 8337, 43091, 68453
appharbor, bitbucket, kiln, mercurial, version-control
<h1>Push to multiple remote repositories from a single local repo in Mercurial</h1> <p>I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration.</p> <p>Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration.<...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,931
mercurial
# Push to multiple remote repositories from a single local repo in Mercurial I was considering using AppHarbor to host a lightweight website and was investigating their Mercurial integration. Currently I use Kiln for my remote repositories, but currently AppHarbor only supports BitBucket integration. Is it possible ...
You can set multiple remote repository aliases in the `[paths]` section of the repository configuration file. This file is in .hg/hgrc, and you would add paths like this ``` [paths] default = http://kilnhg.com/repo bitbucket = http://bitbucket.org/repo ``` Then you would run `hg push bitbucket` to push to bitbucket a...
34484582
How to check which branch you are on with mercurial
25
2015-12-27 20:36:54
<p>What is the best way to check which branch I am on with mercurial?</p> <pre><code>hg log -l 5 </code></pre> <p>This seems to show me the latest commits in the repo and not about working state as git would, so I'm looking for something like <code>git status</code> I suppose, which would tell me what branch I am on....
29,039
219,166
2018-01-29 09:08:09
34,484,633
45
2015-12-27 20:42:08
267
2015-12-27 20:42:08
https://stackoverflow.com/q/34484582
https://stackoverflow.com/a/34484633
<p>You can use the <code>hg identify</code> command with the <code>-b</code> for branch option:</p> <pre><code>C:\Some\Repository&gt; hg identify -b default </code></pre>
<p>You can use the <code>hg identify</code> command with the <code>-b</code> for branch option:</p> <pre><code>C:\Some\Repository&gt; hg identify -b default </code></pre>
802, 1879
branch, mercurial
<h1>How to check which branch you are on with mercurial</h1> <p>What is the best way to check which branch I am on with mercurial?</p> <pre><code>hg log -l 5 </code></pre> <p>This seems to show me the latest commits in the repo and not about working state as git would, so I'm looking for something like <code>git stat...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,932
mercurial
# How to check which branch you are on with mercurial What is the best way to check which branch I am on with mercurial? ``` hg log -l 5 ``` This seems to show me the latest commits in the repo and not about working state as git would, so I'm looking for something like `git status` I suppose, which would tell me wha...
You can use the `hg identify` command with the `-b` for branch option: ``` C:\Some\Repository> hg identify -b default ```
1537616
Handling renames: svn vs. git vs. mercurial
47
2009-10-08 12:55:57
<p>How do each of these VCS handle renames?</p> <p>I have found a lot of contradicting information stating that git tracks LOC (lines of code) instead of files, renames would therefore have no meaning for it.</p>
10,083
125,407
2017-11-24 14:36:40
1,537,768
44
2009-10-08 13:21:27
148,532
2009-10-08 13:21:27
https://stackoverflow.com/q/1537616
https://stackoverflow.com/a/1537768
<ul> <li>Git doesn't track renames at all, but uses heuristic to re-discover them during merge etc.</li> <li>Mercurial tracks renames (the origin version and origin file is recorded) and uses that information during merges. So you have to explicitly tell hg about renames with <code>hg mv</code>, or use <code>hg addremo...
<ul> <li>Git doesn't track renames at all, but uses heuristic to re-discover them during merge etc.</li> <li>Mercurial tracks renames (the origin version and origin file is recorded) and uses that information during merges. So you have to explicitly tell hg about renames with <code>hg mv</code>, or use <code>hg addremo...
63, 119, 456, 802, 4510
git, mercurial, rename, svn, version-control
<h1>Handling renames: svn vs. git vs. mercurial</h1> <p>How do each of these VCS handle renames?</p> <p>I have found a lot of contradicting information stating that git tracks LOC (lines of code) instead of files, renames would therefore have no meaning for it.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,933
mercurial
# Handling renames: svn vs. git vs. mercurial How do each of these VCS handle renames? I have found a lot of contradicting information stating that git tracks LOC (lines of code) instead of files, renames would therefore have no meaning for it.
- Git doesn't track renames at all, but uses heuristic to re-discover them during merge etc. - Mercurial tracks renames (the origin version and origin file is recorded) and uses that information during merges. So you have to explicitly tell hg about renames with `hg mv`, or use `hg addremove --similarity` for auto-disc...
3933693
Is there a way to not have Bitbucket ask for my password every time when doing remote Mercurial operations?
39
2010-10-14 13:34:53
<p>With all other Mercurial repos that I push to, I can set my username and password in my hgrc (actually, Mercurial.ini since I'm using Windows) for doing operations at a particular domain, and Mercurial won't prompt me for auth info. However, even with these settings in place, Bitbucket <em>always</em> asks for my p...
9,309
767
2011-04-11 07:19:17
3,935,393
44
2010-10-14 16:29:23
767
2010-10-14 16:29:23
https://stackoverflow.com/q/3933693
https://stackoverflow.com/a/3935393
<p>Turns out the issue here was that I was using the URL for the repository displayed on my Bitbucket repository's page, which includes the username in front of the bitbucket domain name, so it ended up looking like <code>https://myusername@bitbucket.org/myusername/myrepo</code>. </p> <p>Apparently, when the usernam...
<p>Turns out the issue here was that I was using the URL for the repository displayed on my Bitbucket repository's page, which includes the username in front of the bitbucket domain name, so it ended up looking like <code>https://myusername@bitbucket.org/myusername/myrepo</code>. </p> <p>Apparently, when the usernam...
802, 8337
bitbucket, mercurial
<h1>Is there a way to not have Bitbucket ask for my password every time when doing remote Mercurial operations?</h1> <p>With all other Mercurial repos that I push to, I can set my username and password in my hgrc (actually, Mercurial.ini since I'm using Windows) for doing operations at a particular domain, and Mercuria...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,934
mercurial
# Is there a way to not have Bitbucket ask for my password every time when doing remote Mercurial operations? With all other Mercurial repos that I push to, I can set my username and password in my hgrc (actually, Mercurial.ini since I'm using Windows) for doing operations at a particular domain, and Mercurial won't p...
Turns out the issue here was that I was using the URL for the repository displayed on my Bitbucket repository's page, which includes the username in front of the bitbucket domain name, so it ended up looking like `https://myusername@bitbucket.org/myusername/myrepo`. Apparently, when the username is provided in this wa...
2795994
Can I get hg log to print the history in reverse order?
33
2010-05-08 23:10:06
<p>If not, is this a feature that git has?</p>
8,479
310,121
2018-02-22 10:18:22
2,796,076
44
2010-05-08 23:44:43
6,309
2018-02-22 10:18:22
https://stackoverflow.com/q/2795994
https://stackoverflow.com/a/2796076
<p><a href="https://stackoverflow.com/questions/2795994/can-i-get-hg-log-to-print-the-history-in-reverse-order/2796024#2796024">YGL's answer</a> is the right one for log, see <a href="http://old.nabble.com/Show-log-in-reverse-order-td28158687.html" rel="noreferrer">this thread</a>:</p> <blockquote> <p>The hint from &qu...
<p><a href="https://stackoverflow.com/questions/2795994/can-i-get-hg-log-to-print-the-history-in-reverse-order/2796024#2796024">YGL's answer</a> is the right one for log, see <a href="http://old.nabble.com/Show-log-in-reverse-order-td28158687.html" rel="noreferrer">this thread</a>:</p> <blockquote> <p>The hint from &qu...
119, 802, 942, 1318, 1355
git, history, logging, mercurial, reverse
<h1>Can I get hg log to print the history in reverse order?</h1> <p>If not, is this a feature that git has?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,935
mercurial
# Can I get hg log to print the history in reverse order? If not, is this a feature that git has?
[YGL's answer](https://stackoverflow.com/questions/2795994/can-i-get-hg-log-to-print-the-history-in-reverse-order/2796024#2796024) is the right one for log, see [this thread](http://old.nabble.com/Show-log-in-reverse-order-td28158687.html): > The hint from "hg help log" might be: > "If no revision range is specified...
9617117
How to uncommit in mercurial for my last commit(not yet pushed)
30
2012-03-08 11:43:28
<p>I have situation like this:</p> <blockquote> <p>I have commited files a,b,c,d.Now i found that by mistake i commited files a and b; so before pushing these changes, i want to do uncommit files a and b so that i can push only c and d.Can someone tell me how to do that by using mercurial commands.</p> </bloc...
35,852
1,211,128
2017-06-16 15:56:19
9,617,214
44
2012-03-08 11:51:08
589,746
2014-03-11 19:12:24
https://stackoverflow.com/q/9617117
https://stackoverflow.com/a/9617214
<p>Assuming you haven't performed any other transactions on your repository since you committed the files, I think you could do this as a 2 stage process:</p> <pre><code>hg rollback hg commit filec filed </code></pre> <p><code>hg rollback</code> should remove the commit that you have just made, but leave the files as...
<p>Assuming you haven't performed any other transactions on your repository since you committed the files, I think you could do this as a 2 stage process:</p> <pre><code>hg rollback hg commit filec filed </code></pre> <p><code>hg rollback</code> should remove the commit that you have just made, but leave the files as...
802
mercurial
<h1>How to uncommit in mercurial for my last commit(not yet pushed)</h1> <p>I have situation like this:</p> <blockquote> <p>I have commited files a,b,c,d.Now i found that by mistake i commited files a and b; so before pushing these changes, i want to do uncommit files a and b so that i can push only c and d.Can...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,936
mercurial
# How to uncommit in mercurial for my last commit(not yet pushed) I have situation like this: > I have commited files a,b,c,d.Now i found that by mistake i commited > files a and b; so before pushing these changes, i want to do uncommit > files a and b so that i can push only c and d.Can someone tell me how > to do t...
Assuming you haven't performed any other transactions on your repository since you committed the files, I think you could do this as a 2 stage process: ``` hg rollback hg commit filec filed ``` `hg rollback` should remove the commit that you have just made, but leave the files as changed. Then `hg commit filec filed`...
2908102
Check in single file with Mercurial?
29
2010-05-25 20:02:57
<p>Let's say you do <code>hg status</code> and you have three files modified. I know how to check in all three files (<code>hg commit</code>). But how can you check in (and then <code>hg push</code>) just <em>one</em> of the modified files?</p>
15,195
47,281
2018-02-28 11:45:22
2,911,043
44
2010-05-26 07:54:50
110,204
2011-12-07 08:07:13
https://stackoverflow.com/q/2908102
https://stackoverflow.com/a/2911043
<p>Please check <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer">the output of <code>hg help commit</code></a> which reveals that you can do</p> <pre><code>hg commit foo.c </code></pre> <p>if you just want to commit a single file. This is just like Subversion and many other systems — no ho...
<p>Please check <a href="http://www.selenic.com/mercurial/hg.1.html#commit" rel="noreferrer">the output of <code>hg help commit</code></a> which reveals that you can do</p> <pre><code>hg commit foo.c </code></pre> <p>if you just want to commit a single file. This is just like Subversion and many other systems — no ho...
456, 802, 3346
dvcs, mercurial, version-control
<h1>Check in single file with Mercurial?</h1> <p>Let's say you do <code>hg status</code> and you have three files modified. I know how to check in all three files (<code>hg commit</code>). But how can you check in (and then <code>hg push</code>) just <em>one</em> of the modified files?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,937
mercurial
# Check in single file with Mercurial? Let's say you do `hg status` and you have three files modified. I know how to check in all three files (`hg commit`). But how can you check in (and then `hg push`) just *one* of the modified files?
Please check [the output of `hg help commit`](http://www.selenic.com/mercurial/hg.1.html#commit) which reveals that you can do ``` hg commit foo.c ``` if you just want to commit a single file. This is just like Subversion and many other systems — no hocus-pocus :-)
3136648
How do I exit Vim when doing a Mercurial commit at the command line?
26
2010-06-28 22:36:08
<p>I'm on a Mac running OS&nbsp;X&nbsp;v10.6 (Snow&nbsp;Leopard). I have Mercurial 1.1 installed.</p> <p>After I hit <kbd>Esc</kbd> to exit insert mode I can't figure out how to save and quit. Hitting <kbd>Ctrl</kbd> + <kbd>C</kbd> shows me instructions that say typing "quit" will write and quit, but it doesn't seem t...
60,507
274,053
2019-09-12 15:21:14
3,136,659
44
2010-06-28 22:39:18
372,757
2019-09-12 15:16:29
https://stackoverflow.com/q/3136648
https://stackoverflow.com/a/3136659
<p><code>:q[uit]</code> quits.</p> <p><code>:w[rite]</code> saves.</p> <p><code>:wq</code> is a shortcut for both</p> <p><code>:!command</code> runs a command in a shell (you could use this to commit without having to leave Vim)</p>
<p><code>:q[uit]</code> quits.</p> <p><code>:w[rite]</code> saves.</p> <p><code>:wq</code> is a shortcut for both</p> <p><code>:!command</code> runs a command in a shell (you could use this to commit without having to leave Vim)</p>
293, 391, 802, 5597
commit, mercurial, terminal, vi
<h1>How do I exit Vim when doing a Mercurial commit at the command line?</h1> <p>I'm on a Mac running OS&nbsp;X&nbsp;v10.6 (Snow&nbsp;Leopard). I have Mercurial 1.1 installed.</p> <p>After I hit <kbd>Esc</kbd> to exit insert mode I can't figure out how to save and quit. Hitting <kbd>Ctrl</kbd> + <kbd>C</kbd> shows me ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,938
mercurial
# How do I exit Vim when doing a Mercurial commit at the command line? I'm on a Mac running OS X v10.6 (Snow Leopard). I have Mercurial 1.1 installed. After I hit `Esc` to exit insert mode I can't figure out how to save and quit. Hitting `Ctrl` + `C` shows me instructions that say typing "quit" will write and quit, b...
`:q[uit]` quits. `:w[rite]` saves. `:wq` is a shortcut for both `:!command` runs a command in a shell (you could use this to commit without having to leave Vim)
12957604
Creating a mercurial log for a specific branch
36
2012-10-18 14:55:59
<p>Is it possible to pull changes for just a single branch vs. the entire repository. We have parallel development on different branches and do not want changes from another build in the log. </p> <pre><code>hg log -r %baseversion%:%releaseversion% --style changelog &gt;&gt; hglog.txt </code></pre> <p>I tried doing...
15,215
1,327,438
2017-06-20 09:33:52
12,957,698
42
2012-10-18 15:00:09
663,053
2017-06-20 09:33:52
https://stackoverflow.com/q/12957604
https://stackoverflow.com/a/12957698
<p>If you're using proper hg branches, then you should be able to use the --only-branch option:</p> <pre><code>hg log --only-branch my_branch </code></pre> <p>That will show the changesets only for a given branch.</p> <p><em>Edit</em>: Looks like "--only-branch" is deprecated, but depending on the version of mercuri...
<p>If you're using proper hg branches, then you should be able to use the --only-branch option:</p> <pre><code>hg log --only-branch my_branch </code></pre> <p>That will show the changesets only for a given branch.</p> <p><em>Edit</em>: Looks like "--only-branch" is deprecated, but depending on the version of mercuri...
802, 1231
command-line, mercurial
<h1>Creating a mercurial log for a specific branch</h1> <p>Is it possible to pull changes for just a single branch vs. the entire repository. We have parallel development on different branches and do not want changes from another build in the log. </p> <pre><code>hg log -r %baseversion%:%releaseversion% --style chan...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,940
mercurial
# Creating a mercurial log for a specific branch Is it possible to pull changes for just a single branch vs. the entire repository. We have parallel development on different branches and do not want changes from another build in the log. ``` hg log -r %baseversion%:%releaseversion% --style changelog >> hglog.txt ``` ...
If you're using proper hg branches, then you should be able to use the --only-branch option: ``` hg log --only-branch my_branch ``` That will show the changesets only for a given branch. *Edit*: Looks like "--only-branch" is deprecated, but depending on the version of mercurial you use it will still be there. See <h...
29539866
In Mercurial what's the difference between hg graft and hg rebase
35
2015-04-09 13:27:59
<p>I know <a href="https://www.mercurial-scm.org/wiki/RebaseExtension" rel="noreferrer">Rebase</a> is a (bundled) extension, while <a href="http://selenic.com/hg/help/graft" rel="noreferrer">Graft</a> is a core feature (that replaced the <a href="https://www.mercurial-scm.org/wiki/TransplantExtension" rel="noreferrer">...
33,750
3,679,043
2018-02-22 10:32:58
29,540,330
42
2015-04-09 13:46:29
2,057,919
2018-02-22 10:32:41
https://stackoverflow.com/q/29539866
https://stackoverflow.com/a/29540330
<p><code>hg graft</code> allows "cherry-picking," as you noted in your question. For example, you can run <code>hg graft -D "2085::2093 and not 2091"</code> to copy only <em>some</em> changes from another revision. By comparison, <code>hg rebase</code> (with or without <code>--keep</code>) will grab whatever changeset ...
<p><code>hg graft</code> allows "cherry-picking," as you noted in your question. For example, you can run <code>hg graft -D "2085::2093 and not 2091"</code> to copy only <em>some</em> changes from another revision. By comparison, <code>hg rebase</code> (with or without <code>--keep</code>) will grab whatever changeset ...
802, 8974
mercurial, rebase
<h1>In Mercurial what's the difference between hg graft and hg rebase</h1> <p>I know <a href="https://www.mercurial-scm.org/wiki/RebaseExtension" rel="noreferrer">Rebase</a> is a (bundled) extension, while <a href="http://selenic.com/hg/help/graft" rel="noreferrer">Graft</a> is a core feature (that replaced the <a href...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,941
mercurial
# In Mercurial what's the difference between hg graft and hg rebase I know [Rebase](https://www.mercurial-scm.org/wiki/RebaseExtension) is a (bundled) extension, while [Graft](http://selenic.com/hg/help/graft) is a core feature (that replaced the [Transplant](https://www.mercurial-scm.org/wiki/TransplantExtension) (bu...
`hg graft` allows "cherry-picking," as you noted in your question. For example, you can run `hg graft -D "2085::2093 and not 2091"` to copy only *some* changes from another revision. By comparison, `hg rebase` (with or without `--keep`) will grab whatever changeset you specify and *all* of its decendant changes. Also,...
22045248
Hg: How to move files (to subfolder) without losing history?
50
2014-02-26 15:02:52
<p>How to move files (to subfolder) without losing their history?</p> <p>In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from <strong>MyProject/</strong> to <strong>MyProject/src/</stron...
36,597
964,478
2015-03-27 20:18:26
22,055,830
41
2014-02-26 23:30:20
2,898,065
2014-02-26 23:35:36
https://stackoverflow.com/q/22045248
https://stackoverflow.com/a/22055830
<pre><code>hg mv </code></pre> <p>does do the right thing, but <code>hg log</code> does not list entries past the move unless you give it the <code>-f</code> option. See this question for more info </p> <p><a href="https://stackoverflow.com/questions/5264528/why-hg-mv-mercurial-doesnt-move-a-files-history-by-default...
<pre><code>hg mv </code></pre> <p>does do the right thing, but <code>hg log</code> does not list entries past the move unless you give it the <code>-f</code> option. See this question for more info </p> <p><a href="https://stackoverflow.com/questions/5264528/why-hg-mv-mercurial-doesnt-move-a-files-history-by-default...
802, 8122
mercurial, tortoisehg
<h1>Hg: How to move files (to subfolder) without losing history?</h1> <p>How to move files (to subfolder) without losing their history?</p> <p>In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,942
mercurial
# Hg: How to move files (to subfolder) without losing history? How to move files (to subfolder) without losing their history? In my Mercurial repository (I mean the folder with the .hg in it) I have MyProject/ folder with all project files. Now I need to create src/ folder inside and move all files to it (from **MyPr...
``` hg mv ``` does do the right thing, but `hg log` does not list entries past the move unless you give it the `-f` option. See this question for more info [Why 'hg mv' (mercurial) doesn't move a file's history by default?](https://stackoverflow.com/questions/5264528/why-hg-mv-mercurial-doesnt-move-a-files-history-by...
2175777
Undo a remove action in Mercurial
43
2010-02-01 09:49:26
<p>Suppose that I have made some changes in the working directory and accidentally marked several files (that include some of the modified ones) for removal. How do I unmark the files for removal without losing the changes I have made?</p>
26,715
129,363
2022-03-11 22:22:34
10,555,936
41
2012-05-11 17:25:40
8,992
2012-05-11 17:25:40
https://stackoverflow.com/q/2175777
https://stackoverflow.com/a/10555936
<p>Just <code>hg add</code> the files.</p> <p>I don't know why you're getting some many answers that modify the working directory. If you've accidentally marked some files for removal you can undo it with add.</p> <pre><code>ry4an@four:~/hgtest$ hg status --all M another_file C a_file ry4an@four:~/hgtest$ hg remove ...
<p>Just <code>hg add</code> the files.</p> <p>I don't know why you're getting some many answers that modify the working directory. If you've accidentally marked some files for removal you can undo it with add.</p> <pre><code>ry4an@four:~/hgtest$ hg status --all M another_file C a_file ry4an@four:~/hgtest$ hg remove ...
802
mercurial
<h1>Undo a remove action in Mercurial</h1> <p>Suppose that I have made some changes in the working directory and accidentally marked several files (that include some of the modified ones) for removal. How do I unmark the files for removal without losing the changes I have made?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,943
mercurial
# Undo a remove action in Mercurial Suppose that I have made some changes in the working directory and accidentally marked several files (that include some of the modified ones) for removal. How do I unmark the files for removal without losing the changes I have made?
Just `hg add` the files. I don't know why you're getting some many answers that modify the working directory. If you've accidentally marked some files for removal you can undo it with add. ``` ry4an@four:~/hgtest$ hg status --all M another_file C a_file ry4an@four:~/hgtest$ hg remove --after --force * ry4an@four:~/hg...
3472216
In Mercurial, "hg rename" works but the history doesn't follow the file?
35
2010-08-12 21:31:05
<p>I remember in SVN, I can rename a file from foo.txt to foo2.txt and all the history will follow (log file of foo2.txt will show all history of foo.txt as well). But on Mercurial, seems like that's not the case. When a <code>hg rename</code> is done, then <code>hg log foo2.txt</code> will not show any previous hist...
19,950
325,418
2014-02-14 07:37:13
3,472,289
41
2010-08-12 21:42:14
19,465
2010-08-12 21:42:14
https://stackoverflow.com/q/3472216
https://stackoverflow.com/a/3472289
<p>Use <code>hg log --follow foo2.txt</code> or <code>hg log -f foo2.txt</code> (short form) to show you the entire history of the file before the <code>hg rename</code></p>
<p>Use <code>hg log --follow foo2.txt</code> or <code>hg log -f foo2.txt</code> (short form) to show you the entire history of the file before the <code>hg rename</code></p>
802
mercurial
<h1>In Mercurial, "hg rename" works but the history doesn't follow the file?</h1> <p>I remember in SVN, I can rename a file from foo.txt to foo2.txt and all the history will follow (log file of foo2.txt will show all history of foo.txt as well). But on Mercurial, seems like that's not the case. When a <code>hg rename...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,944
mercurial
# In Mercurial, "hg rename" works but the history doesn't follow the file? I remember in SVN, I can rename a file from foo.txt to foo2.txt and all the history will follow (log file of foo2.txt will show all history of foo.txt as well). But on Mercurial, seems like that's not the case. When a `hg rename` is done, then ...
Use `hg log --follow foo2.txt` or `hg log -f foo2.txt` (short form) to show you the entire history of the file before the `hg rename`
2354527
Is `hg pull --rebase` analogous to `svn update`?
22
2010-03-01 08:15:32
<p>This question assumes there's a "blessed" central repository that members of a team</p> <ol> <li>clone from</li> <li>push to when they have contributions that they want other team members to see</li> <li>pull from when they want to see other people's contributions.</li> <li>etc.</li> </ol> <p>If so, I would assume...
5,756
62,163
2017-05-31 11:52:43
2,487,572
41
2010-03-21 15:25:06
1,385,039
2010-03-21 15:25:06
https://stackoverflow.com/q/2354527
https://stackoverflow.com/a/2487572
<p>As others have indicated, almost but not quite. In order of decreasing similarity to <code>svn update</code> (and increasing compliance with general DVCS, and specifically Mercurial, best practices[1]):</p> <ol> <li><p><code>hg pull -u</code> (or <code>hg pull</code> followed by <code>hg update</code>) with your c...
<p>As others have indicated, almost but not quite. In order of decreasing similarity to <code>svn update</code> (and increasing compliance with general DVCS, and specifically Mercurial, best practices[1]):</p> <ol> <li><p><code>hg pull -u</code> (or <code>hg pull</code> followed by <code>hg update</code>) with your c...
63, 456, 802
mercurial, svn, version-control
<h1>Is `hg pull --rebase` analogous to `svn update`?</h1> <p>This question assumes there's a "blessed" central repository that members of a team</p> <ol> <li>clone from</li> <li>push to when they have contributions that they want other team members to see</li> <li>pull from when they want to see other people's contrib...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,945
mercurial
# Is `hg pull --rebase` analogous to `svn update`? This question assumes there's a "blessed" central repository that members of a team 1. clone from 2. push to when they have contributions that they want other team members to see 3. pull from when they want to see other people's contributions. 4. etc. If so, I would...
As others have indicated, almost but not quite. In order of decreasing similarity to `svn update` (and increasing compliance with general DVCS, and specifically Mercurial, best practices[1]): 1. `hg pull -u` (or `hg pull` followed by `hg update`) with your changes uncommitted and no committed changes since your last p...
10305643
How do I revert a file to 'last checkin' state in Mercurial?
33
2012-04-24 20:37:55
<p>I have a hypothetical Mercurial repository on disc. I'm most of the way through creating a new feature, when I realise I've made a complete mess of the file I'm working on, and want to revert that file back to its last commit state. </p> <p>I can use <code>hg update</code> to refresh the working copy from the repos...
31,091
301,032
2012-04-26 20:08:38
10,305,711
40
2012-04-24 20:43:11
1,052,722
2012-04-24 20:43:11
https://stackoverflow.com/q/10305643
https://stackoverflow.com/a/10305711
<p>There is a mercurial command to revert files. <code>hg revert</code> this should revert any changes. You can also pass a file name to it e.g <code>hg revert fileName</code>.</p>
<p>There is a mercurial command to revert files. <code>hg revert</code> this should revert any changes. You can also pass a file name to it e.g <code>hg revert fileName</code>.</p>
802, 5766
mercurial, undo
<h1>How do I revert a file to 'last checkin' state in Mercurial?</h1> <p>I have a hypothetical Mercurial repository on disc. I'm most of the way through creating a new feature, when I realise I've made a complete mess of the file I'm working on, and want to revert that file back to its last commit state. </p> <p>I can...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,947
mercurial
# How do I revert a file to 'last checkin' state in Mercurial? I have a hypothetical Mercurial repository on disc. I'm most of the way through creating a new feature, when I realise I've made a complete mess of the file I'm working on, and want to revert that file back to its last commit state. I can use `hg update` ...
There is a mercurial command to revert files. `hg revert` this should revert any changes. You can also pass a file name to it e.g `hg revert fileName`.
10448788
Merging two different repositories
32
2012-05-04 12:27:43
<p>I've 3 repos, A, B and C, all related to the same project. A is the oldest version of the project, B is an experiment that didn't really go anywhere and C is the latest working version. All these repos have different files - they're different implementations of the same product.</p> <p>I'd like to merge these 3 repo...
12,335
70,600
2022-01-14 14:18:00
10,450,591
40
2012-05-04 14:14:04
110,204
2018-02-22 10:24:39
https://stackoverflow.com/q/10448788
https://stackoverflow.com/a/10450591
<p>You can just pull the changesets into one big repository. Start with the A repo:</p> <pre><code>$ hg init combined $ cd combined $ hg pull ../A $ hg update </code></pre> <p>Then forcibly pull in B and dummy-merge the two heads so that you keep the files from B:</p> <pre><code>$ hg pull ../B --force $ hg merge --t...
<p>You can just pull the changesets into one big repository. Start with the A repo:</p> <pre><code>$ hg init combined $ cd combined $ hg pull ../A $ hg update </code></pre> <p>Then forcibly pull in B and dummy-merge the two heads so that you keep the files from B:</p> <pre><code>$ hg pull ../B --force $ hg merge --t...
717, 802
mercurial, merge
<h1>Merging two different repositories</h1> <p>I've 3 repos, A, B and C, all related to the same project. A is the oldest version of the project, B is an experiment that didn't really go anywhere and C is the latest working version. All these repos have different files - they're different implementations of the same pr...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,948
mercurial
# Merging two different repositories I've 3 repos, A, B and C, all related to the same project. A is the oldest version of the project, B is an experiment that didn't really go anywhere and C is the latest working version. All these repos have different files - they're different implementations of the same product. I...
You can just pull the changesets into one big repository. Start with the A repo: ``` $ hg init combined $ cd combined $ hg pull ../A $ hg update ``` Then forcibly pull in B and dummy-merge the two heads so that you keep the files from B: ``` $ hg pull ../B --force $ hg merge --tool internal:other $ hg revert --all -...
21655574
"stream ended unexpectedly" on clone
25
2014-02-09 05:09:46
<p>I try to clone but I get a rollback. I could clone at another computer previously but now I get a rollback and I don't know why:</p> <pre><code>C:\Users\Niklas\montao&gt;hg clone https://niklasr@bitbucket.org/niklasr/montao http authorization required realm: Bitbucket.org HTTP user: niklasr password: destination di...
14,287
108,207
2018-03-24 12:14:34
21,668,546
40
2014-02-10 03:18:04
8,992
2016-09-16 22:54:58
https://stackoverflow.com/q/21655574
https://stackoverflow.com/a/21668546
<p>Your TCP connection to bitbucket is dying before the whole repo is downloaded -- probably a flaky net connection or a full disk. If it's the former you can do it in small chunks using <code>-r</code> like this:</p> <pre><code>hg init montao cd montao hg pull -r 50 https://niklasr@bitbucket.org/niklasr/montao # ge...
<p>Your TCP connection to bitbucket is dying before the whole repo is downloaded -- probably a flaky net connection or a full disk. If it's the former you can do it in small chunks using <code>-r</code> like this:</p> <pre><code>hg init montao cd montao hg pull -r 50 https://niklasr@bitbucket.org/niklasr/montao # ge...
802, 8337
bitbucket, mercurial
<h1>"stream ended unexpectedly" on clone</h1> <p>I try to clone but I get a rollback. I could clone at another computer previously but now I get a rollback and I don't know why:</p> <pre><code>C:\Users\Niklas\montao&gt;hg clone https://niklasr@bitbucket.org/niklasr/montao http authorization required realm: Bitbucket.o...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,950
mercurial
# "stream ended unexpectedly" on clone I try to clone but I get a rollback. I could clone at another computer previously but now I get a rollback and I don't know why: ``` C:\Users\Niklas\montao>hg clone https://niklasr@bitbucket.org/niklasr/montao http authorization required realm: Bitbucket.org HTTP user: niklasr p...
Your TCP connection to bitbucket is dying before the whole repo is downloaded -- probably a flaky net connection or a full disk. If it's the former you can do it in small chunks using `-r` like this: ``` hg init montao cd montao hg pull -r 50 https://niklasr@bitbucket.org/niklasr/montao # get the first 50 changesets ...
6293167
Disabling HTTPS host authentication in TortoiseHG for internal self-signed certificates
21
2011-06-09 13:01:15
<p>How do you disable HTTPS host authentication in TortoiseHG for internal self-signed certificates. For internal servers HTTPS is primarily used for encryption. </p> <p>The TortoiseHG documentation says that it is possible to disable host verification (i.e. verification against the Certificate Authority chain) <a hre...
25,233
340,088
2018-02-22 10:26:48
6,296,886
40
2011-06-09 17:30:36
22,211
2018-02-22 10:26:33
https://stackoverflow.com/q/6293167
https://stackoverflow.com/a/6296886
<p>In the TortoiseHG Workbench, in the Sync tab (or in the Sync screen), if you have a remote path selected, you should see a button with a lock icon on it:</p> <p><img src="https://i.sstatic.net/cfOs5.jpg" alt="enter image description here"></p> <p>That will bring up the Security window, where you can select the opt...
<p>In the TortoiseHG Workbench, in the Sync tab (or in the Sync screen), if you have a remote path selected, you should see a button with a lock icon on it:</p> <p><img src="https://i.sstatic.net/cfOs5.jpg" alt="enter image description here"></p> <p>That will bring up the Security window, where you can select the opt...
802, 8122, 68498
mercurial, tortoisehg, tortoisehg-2.0
<h1>Disabling HTTPS host authentication in TortoiseHG for internal self-signed certificates</h1> <p>How do you disable HTTPS host authentication in TortoiseHG for internal self-signed certificates. For internal servers HTTPS is primarily used for encryption. </p> <p>The TortoiseHG documentation says that it is possibl...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,951
mercurial
# Disabling HTTPS host authentication in TortoiseHG for internal self-signed certificates How do you disable HTTPS host authentication in TortoiseHG for internal self-signed certificates. For internal servers HTTPS is primarily used for encryption. The TortoiseHG documentation says that it is possible to disable host...
In the TortoiseHG Workbench, in the Sync tab (or in the Sync screen), if you have a remote path selected, you should see a button with a lock icon on it: ![enter image description here](https://i.sstatic.net/cfOs5.jpg) That will bring up the Security window, where you can select the option `No host validation, but st...
2963040
How to clone repository to a remote server/repository with Mercurial
28
2010-06-03 02:50:48
<p>Found myself quite confused today about this.</p> <p>I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to local repo obviously).</p> <p>Now I need to share that repository with others. There is a server that has mercurial on it, how do I clone my repos...
31,738
90,268
2018-02-22 10:19:38
2,963,113
39
2010-06-03 03:14:01
8,992
2018-02-22 10:19:38
https://stackoverflow.com/q/2963040
https://stackoverflow.com/a/2963113
<p>You'll want to check out the <a href="https://www.mercurial-scm.org/wiki/PublishingRepositories" rel="nofollow noreferrer">publishing repositories</a> wiki page to get into web interfaces and access controls, but at it's most basic you can do something like this:</p> <pre><code>hg clone yourlocalrepo ssh://you@serv...
<p>You'll want to check out the <a href="https://www.mercurial-scm.org/wiki/PublishingRepositories" rel="nofollow noreferrer">publishing repositories</a> wiki page to get into web interfaces and access controls, but at it's most basic you can do something like this:</p> <pre><code>hg clone yourlocalrepo ssh://you@serv...
802
mercurial
<h1>How to clone repository to a remote server/repository with Mercurial</h1> <p>Found myself quite confused today about this.</p> <p>I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to local repo obviously).</p> <p>Now I need to share that repository wi...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,953
mercurial
# How to clone repository to a remote server/repository with Mercurial Found myself quite confused today about this. I create a blank repository locally(hg init), cloned it to working copy, added some code, commited and pushed it(to local repo obviously). Now I need to share that repository with others. There is a s...
You'll want to check out the [publishing repositories](https://www.mercurial-scm.org/wiki/PublishingRepositories) wiki page to get into web interfaces and access controls, but at it's most basic you can do something like this: ``` hg clone yourlocalrepo ssh://you@server//home/you/repo ``` That clones your local repo ...
25859069
Using PinchGesture; how can I zoom in to where a user's fingers actually "pinch"?
20
2014-09-16 00:47:54
<p>I've implemented the UIPinchGestureRecognizer on a UIImageView in my app, however no matter where I pinch on the image, it seems to zoom into the same spot. Does anyone know how I can make it zoom in to where a user actually "pinches"? See code below.</p> <p><strong>ViewController.m</strong></p> <pre><code> - (IBA...
17,466
3,030,060
2018-10-09 19:07:32
25,861,070
39
2014-09-16 05:11:34
77,567
2014-09-16 05:11:34
https://stackoverflow.com/q/25859069
https://stackoverflow.com/a/25861070
<p>A scale transform leaves the origin (0, 0) untouched. So to scale a view around a particular point, you must first translate that point to the origin, then apply the scale, then translate back.</p> <pre><code>- (IBAction)pinchGestureDidFire:(UIPinchGestureRecognizer *)pinch { </code></pre> <p>First, we get the vi...
<p>A scale transform leaves the origin (0, 0) untouched. So to scale a view around a particular point, you must first translate that point to the origin, then apply the scale, then translate back.</p> <pre><code>- (IBAction)pinchGestureDidFire:(UIPinchGestureRecognizer *)pinch { </code></pre> <p>First, we get the vi...
7003, 58338, 77205
ios, objective-c, uipinchgesturerecognizer
<h1>Using PinchGesture; how can I zoom in to where a user's fingers actually "pinch"?</h1> <p>I've implemented the UIPinchGestureRecognizer on a UIImageView in my app, however no matter where I pinch on the image, it seems to zoom into the same spot. Does anyone know how I can make it zoom in to where a user actually "...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,954
mercurial
# Using PinchGesture; how can I zoom in to where a user's fingers actually "pinch"? I've implemented the UIPinchGestureRecognizer on a UIImageView in my app, however no matter where I pinch on the image, it seems to zoom into the same spot. Does anyone know how I can make it zoom in to where a user actually "pinches"?...
A scale transform leaves the origin (0, 0) untouched. So to scale a view around a particular point, you must first translate that point to the origin, then apply the scale, then translate back. ``` - (IBAction)pinchGestureDidFire:(UIPinchGestureRecognizer *)pinch { ``` First, we get the view being pinched. ``` U...
13763034
What is the difference between hg revert and hg backout?
20
2012-12-07 12:23:35
<p>Both <code>hg revert</code> and <code>hg backout</code> revert changes made by a former revision. What is the difference between the two?</p>
7,211
1,544,277
2012-12-07 13:12:54
13,763,035
39
2012-12-07 12:23:35
1,544,277
2012-12-07 13:12:54
https://stackoverflow.com/q/13763034
https://stackoverflow.com/a/13763035
<p>Given the history of changesets:</p> <pre><code>A --- B --- C --- D --- E [bad] (*) </code></pre> <p><code>hg revert -r B</code>: Stay at current revision, but update the working directory as of revision <code>B</code>. It has the effect of a patch that revokes the changes of <code>C</code>, <cod...
<p>Given the history of changesets:</p> <pre><code>A --- B --- C --- D --- E [bad] (*) </code></pre> <p><code>hg revert -r B</code>: Stay at current revision, but update the working directory as of revision <code>B</code>. It has the effect of a patch that revokes the changes of <code>C</code>, <cod...
802, 12309, 61149
backout, mercurial, revert
<h1>What is the difference between hg revert and hg backout?</h1> <p>Both <code>hg revert</code> and <code>hg backout</code> revert changes made by a former revision. What is the difference between the two?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,955
mercurial
# What is the difference between hg revert and hg backout? Both `hg revert` and `hg backout` revert changes made by a former revision. What is the difference between the two?
Given the history of changesets: ``` A --- B --- C --- D --- E [bad] (*) ``` `hg revert -r B`: Stay at current revision, but update the working directory as of revision `B`. It has the effect of a patch that revokes the changes of `C`, `D` and `E`. `hg backout -r C`: Update the working directory so ...
1512058
hgignore: help ignoring all files but certain ones
43
2009-10-02 22:15:30
<p>I need an .hgdontignore file :-) to include certain files and exclude everything else in a directory. Basically I want to include only the .jar files in a particular directory and nothing else. How can I do this? I'm not that skilled in regular expression syntax. Or can I do it with glob syntax? (I prefer that for r...
17,392
44,330
2020-01-10 09:27:36
1,512,093
38
2009-10-02 22:27:19
65,843
2010-02-03 18:50:44
https://stackoverflow.com/q/1512058
https://stackoverflow.com/a/1512093
<p>To do this, you'll need to use this regular expression:</p> <pre><code>foo/bar/.+?\.(?!jar).+ </code></pre> <p><strong>Explanation</strong></p> <p>You are telling it what to ignore, so this expression is searching for things you <em>don't</em> want.</p> <ol> <li>You look for any file whose name (including relati...
<p>To do this, you'll need to use this regular expression:</p> <pre><code>foo/bar/.+?\.(?!jar).+ </code></pre> <p><strong>Explanation</strong></p> <p>You are telling it what to ignore, so this expression is searching for things you <em>don't</em> want.</p> <ol> <li>You look for any file whose name (including relati...
18, 802, 31419
hgignore, mercurial, regex
<h1>hgignore: help ignoring all files but certain ones</h1> <p>I need an .hgdontignore file :-) to include certain files and exclude everything else in a directory. Basically I want to include only the .jar files in a particular directory and nothing else. How can I do this? I'm not that skilled in regular expression s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,956
mercurial
# hgignore: help ignoring all files but certain ones I need an .hgdontignore file :-) to include certain files and exclude everything else in a directory. Basically I want to include only the .jar files in a particular directory and nothing else. How can I do this? I'm not that skilled in regular expression syntax. Or...
To do this, you'll need to use this regular expression: ``` foo/bar/.+?\.(?!jar).+ ``` **Explanation** You are telling it what to ignore, so this expression is searching for things you *don't* want. 1. You look for any file whose name (including relative directory) includes (foo/bar/) 2. You then look for any chara...
7313178
Mercurial error: repository is unrelated
35
2011-09-05 22:16:37
<p>I've just started with Mercurial, I have a 'central' repository on Bitbucket which I cloned onto one machine and made changes and committed and pushed. I then cloned from Bitbucket to another machine committed and pushed which was fine. I then came back to the first machine, made changes committed and attempted to p...
26,902
138,090
2019-06-20 08:48:09
7,316,257
38
2011-09-06 07:19:21
110,204
2011-09-06 07:19:21
https://stackoverflow.com/q/7313178
https://stackoverflow.com/a/7316257
<p>A Mercurial repository gets its identity when you make the first commit in it. When you create a new repository on Bitbucket, you create an empty repository with no identity.</p> <p>When you clone this repository to machine A and make a commit and push it back, then you brand the repository. If you have cloned the ...
<p>A Mercurial repository gets its identity when you make the first commit in it. When you create a new repository on Bitbucket, you create an empty repository with no identity.</p> <p>When you clone this repository to machine A and make a commit and push it back, then you brand the repository. If you have cloned the ...
802, 3346, 8337
bitbucket, dvcs, mercurial
<h1>Mercurial error: repository is unrelated</h1> <p>I've just started with Mercurial, I have a 'central' repository on Bitbucket which I cloned onto one machine and made changes and committed and pushed. I then cloned from Bitbucket to another machine committed and pushed which was fine. I then came back to the first ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,957
mercurial
# Mercurial error: repository is unrelated I've just started with Mercurial, I have a 'central' repository on Bitbucket which I cloned onto one machine and made changes and committed and pushed. I then cloned from Bitbucket to another machine committed and pushed which was fine. I then came back to the first machine, ...
A Mercurial repository gets its identity when you make the first commit in it. When you create a new repository on Bitbucket, you create an empty repository with no identity. When you clone this repository to machine A and make a commit and push it back, then you brand the repository. If you have cloned the repository...
4505887
Tortoise HG - Add a tag on commit
34
2010-12-22 03:18:49
<p>At the moment, I only know how to add a tag after a commit. This means that a get a second commit that just contains the tag. Is it possible to add a tag on commit?</p>
9,549
165,495
2017-06-20 07:34:08
4,506,049
38
2010-12-22 03:59:44
235,698
2010-12-22 03:59:44
https://stackoverflow.com/q/4505887
https://stackoverflow.com/a/4506049
<p>No, because a tag is an entry in the <code>.hgtags</code> file at the root of your repository containing the changeset id and the tag name, and this file itself is under revision control. The changeset id isn't known until the changeset is created, so tagging creates another changeset to check in the <code>.hgtags<...
<p>No, because a tag is an entry in the <code>.hgtags</code> file at the root of your repository containing the changeset id and the tag name, and this file itself is under revision control. The changeset id isn't known until the changeset is created, so tagging creates another changeset to check in the <code>.hgtags<...
802, 8122
mercurial, tortoisehg
<h1>Tortoise HG - Add a tag on commit</h1> <p>At the moment, I only know how to add a tag after a commit. This means that a get a second commit that just contains the tag. Is it possible to add a tag on commit?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,958
mercurial
# Tortoise HG - Add a tag on commit At the moment, I only know how to add a tag after a commit. This means that a get a second commit that just contains the tag. Is it possible to add a tag on commit?
No, because a tag is an entry in the `.hgtags` file at the root of your repository containing the changeset id and the tag name, and this file itself is under revision control. The changeset id isn't known until the changeset is created, so tagging creates another changeset to check in the `.hgtags` file recording the ...
2760921
Is there a way to export current hg repository head in a tar ball
30
2010-05-03 20:16:36
<p>HI,</p> <p>Is there a way to export current hg repository head in a tar ball? I don't need all the hg meta files in the tar ball (e.g history/diff).</p>
11,092
286,802
2013-02-24 21:44:07
2,760,940
38
2010-05-03 20:19:29
148,870
2012-05-01 04:43:53
https://stackoverflow.com/q/2760921
https://stackoverflow.com/a/2760940
<p>Use <code>hg archive -t tgz &lt;targetpath&gt;</code> to export a clean version as a gzip'd tarball.</p> <p>Alternatively, you can use a different <code>-t</code> flag value to specify a different output type. You can find all of the type (and other) options on the <a href="http://www.selenic.com/mercurial/hg.1.htm...
<p>Use <code>hg archive -t tgz &lt;targetpath&gt;</code> to export a clean version as a gzip'd tarball.</p> <p>Alternatively, you can use a different <code>-t</code> flag value to specify a different output type. You can find all of the type (and other) options on the <a href="http://www.selenic.com/mercurial/hg.1.htm...
802, 4167, 9655
archive, export, mercurial
<h1>Is there a way to export current hg repository head in a tar ball</h1> <p>HI,</p> <p>Is there a way to export current hg repository head in a tar ball? I don't need all the hg meta files in the tar ball (e.g history/diff).</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,959
mercurial
# Is there a way to export current hg repository head in a tar ball HI, Is there a way to export current hg repository head in a tar ball? I don't need all the hg meta files in the tar ball (e.g history/diff).
Use `hg archive -t tgz <targetpath>` to export a clean version as a gzip'd tarball. Alternatively, you can use a different `-t` flag value to specify a different output type. You can find all of the type (and other) options on the [`hg` man page](http://www.selenic.com/mercurial/hg.1.html#archive). In Mercurial 1.6+,...
7475634
Mercurial: Any way to "merge and discard changes"?
24
2011-09-19 18:34:34
<p>I have a graphlog that looks something like this:</p> <pre><code>(snip) | | | o 1) Other Dev: Commit | | \ o | | 2) Me: Commit / | | | | | o | 3) Other Dev: Commits with an error | |/| | | o |/ 4) Me: Merge and commit | /| |/ | o | 5) Me: Realize there were bugs in the commit and take earl...
7,697
5,056
2011-09-19 20:18:51
7,476,481
38
2011-09-19 19:50:31
75,761
2011-09-19 20:18:51
https://stackoverflow.com/q/7475634
https://stackoverflow.com/a/7476481
<p>Yes. The <code>internal:local</code> builtin merge tool.</p> <pre><code>$ hg merge 4 --tool internal:local </code></pre> <p>Similarly there's <code>internal:other</code> that picks the other version of files as the merged version.</p> <p>Here's an example to clarify what's going on, start off with a repo with a s...
<p>Yes. The <code>internal:local</code> builtin merge tool.</p> <pre><code>$ hg merge 4 --tool internal:local </code></pre> <p>Similarly there's <code>internal:other</code> that picks the other version of files as the merged version.</p> <p>Here's an example to clarify what's going on, start off with a repo with a s...
802
mercurial
<h1>Mercurial: Any way to "merge and discard changes"?</h1> <p>I have a graphlog that looks something like this:</p> <pre><code>(snip) | | | o 1) Other Dev: Commit | | \ o | | 2) Me: Commit / | | | | | o | 3) Other Dev: Commits with an error | |/| | | o |/ 4) Me: Merge and commit | /| |/ | o | ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,960
mercurial
# Mercurial: Any way to "merge and discard changes"? I have a graphlog that looks something like this: ``` (snip) | | | o 1) Other Dev: Commit | | \ o | | 2) Me: Commit / | | | | | o | 3) Other Dev: Commits with an error | |/| | | o |/ 4) Me: Merge and commit | /| |/ | o | 5) Me: Realize the...
Yes. The `internal:local` builtin merge tool. ``` $ hg merge 4 --tool internal:local ``` Similarly there's `internal:other` that picks the other version of files as the merged version. Here's an example to clarify what's going on, start off with a repo with a single file: ``` $ echo a >> a $ hg ci -Am. adding a $ e...
1187858
bitbucket, "hg push" and "hg update"
16
2009-07-27 12:16:54
<p>If I start out with a local mercurial repo, which I consider to be the "main" repo (pardon me my dvcs lords), and intend to use bitbucket as a backup and issue tracking facility, I can do all my changes in my local repo and do an "hg push" to send the changes back to bitbucket.</p> <p>Don't I need to follow this "h...
20,485
46,928
2018-02-22 12:53:26
1,188,678
38
2009-07-27 14:59:47
13,498
2009-07-27 21:45:24
https://stackoverflow.com/q/1187858
https://stackoverflow.com/a/1188678
<p>Why do you care what's in the working directory on BitBucket's servers? As long as you push the changes will be in the repository and visible on the BitBucket page.</p> <p><strong>EDIT:</strong> OK, I'm going to edit this to be a useful answer.</p> <p>Say you clone down one of my repositories like django-hoptoad ...
<p>Why do you care what's in the working directory on BitBucket's servers? As long as you push the changes will be in the repository and visible on the BitBucket page.</p> <p><strong>EDIT:</strong> OK, I'm going to edit this to be a useful answer.</p> <p>Say you clone down one of my repositories like django-hoptoad ...
802, 3346, 8337
bitbucket, dvcs, mercurial
<h1>bitbucket, "hg push" and "hg update"</h1> <p>If I start out with a local mercurial repo, which I consider to be the "main" repo (pardon me my dvcs lords), and intend to use bitbucket as a backup and issue tracking facility, I can do all my changes in my local repo and do an "hg push" to send the changes back to bit...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,961
mercurial
# bitbucket, "hg push" and "hg update" If I start out with a local mercurial repo, which I consider to be the "main" repo (pardon me my dvcs lords), and intend to use bitbucket as a backup and issue tracking facility, I can do all my changes in my local repo and do an "hg push" to send the changes back to bitbucket. ...
Why do you care what's in the working directory on BitBucket's servers? As long as you push the changes will be in the repository and visible on the BitBucket page. **EDIT:** OK, I'm going to edit this to be a useful answer. Say you clone down one of my repositories like django-hoptoad on BitBucket. You'll have a fol...
4431884
Cloning a Mercurial repository over SSH
71
2010-12-13 17:58:19
<p>I'm having some difficulty cloning my mercurial repository over ssh.</p> <p>Here's what I have tried:</p> <pre><code>hg clone ssh://username@username.webfactional.com/path/to/projectname projectname </code></pre> <p>It's giving me this error:</p> <pre><code>remote: bash: hg: command not found abort: no suitable ...
63,290
160,225
2018-03-20 10:53:12
4,431,919
37
2010-12-13 18:02:07
394,167
2017-05-31 11:43:55
https://stackoverflow.com/q/4431884
https://stackoverflow.com/a/4431919
<p>Sounds like <code>hg</code> is not on your path. The Mercurial FAQ mentions possible fixes for this issue: <a href="https://www.mercurial-scm.org/wiki/FAQ/CommonProblems" rel="nofollow noreferrer">FAQ/CommonProblems</a>.</p> <p>Add the <code>remotecmd</code> value to your Mercurial configuration by opening <code>~/...
<p>Sounds like <code>hg</code> is not on your path. The Mercurial FAQ mentions possible fixes for this issue: <a href="https://www.mercurial-scm.org/wiki/FAQ/CommonProblems" rel="nofollow noreferrer">FAQ/CommonProblems</a>.</p> <p>Add the <code>remotecmd</code> value to your Mercurial configuration by opening <code>~/...
386, 802, 27844
mercurial, ssh, webfaction
<h1>Cloning a Mercurial repository over SSH</h1> <p>I'm having some difficulty cloning my mercurial repository over ssh.</p> <p>Here's what I have tried:</p> <pre><code>hg clone ssh://username@username.webfactional.com/path/to/projectname projectname </code></pre> <p>It's giving me this error:</p> <pre><code>remote...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,962
mercurial
# Cloning a Mercurial repository over SSH I'm having some difficulty cloning my mercurial repository over ssh. Here's what I have tried: ``` hg clone ssh://username@username.webfactional.com/path/to/projectname projectname ``` It's giving me this error: ``` remote: bash: hg: command not found abort: no suitable re...
Sounds like `hg` is not on your path. The Mercurial FAQ mentions possible fixes for this issue: [FAQ/CommonProblems](https://www.mercurial-scm.org/wiki/FAQ/CommonProblems). Add the `remotecmd` value to your Mercurial configuration by opening `~/.hgrc` (or `Mercurial.ini` on Windows) on your client machine and adding t...
1745000
Can I clone part of a Mercurial repository?
45
2009-11-16 21:34:33
<p>Is it possible to clone part of a Mercurial repository? Let's say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository?</p> <p>E.g. in Subversion, you might have <code>trunk</code> and <code>branches</code>. If I only want to get trunk (or one o...
18,547
3,233
2021-12-22 19:31:27
4,996,790
37
2011-02-14 20:13:26
337,528
2017-05-31 11:39:12
https://stackoverflow.com/q/1745000
https://stackoverflow.com/a/4996790
<p>Yes you can. I'm sure you've moved on, but for the sake of those who will wander here later, I followed the docs at <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="nofollow noreferrer">ConvertExtension</a>, and wrote a simple batch script:</p> <pre><code>@echo off echo Converting %1 REM Create t...
<p>Yes you can. I'm sure you've moved on, but for the sake of those who will wander here later, I followed the docs at <a href="https://www.mercurial-scm.org/wiki/ConvertExtension" rel="nofollow noreferrer">ConvertExtension</a>, and wrote a simple batch script:</p> <pre><code>@echo off echo Converting %1 REM Create t...
802, 3346
dvcs, mercurial
<h1>Can I clone part of a Mercurial repository?</h1> <p>Is it possible to clone part of a Mercurial repository? Let's say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository?</p> <p>E.g. in Subversion, you might have <code>trunk</code> and <code>b...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,963
mercurial
# Can I clone part of a Mercurial repository? Is it possible to clone part of a Mercurial repository? Let's say the repository is quite large, or contains multiple projects, or multiple branches. Can I clone only part of the repository? E.g. in Subversion, you might have `trunk` and `branches`. If I only want to get ...
Yes you can. I'm sure you've moved on, but for the sake of those who will wander here later, I followed the docs at [ConvertExtension](https://www.mercurial-scm.org/wiki/ConvertExtension), and wrote a simple batch script: ``` @echo off echo Converting %1 REM Create the file map echo include %1 > ~myfilemap ...
308491
Show progress of Mercurial push/pull
43
2008-11-21 11:32:01
<p>Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically "no", but does somebody know better? I was expecting something like <code>hg pull -v</code>...</p>
9,206
6,846
2018-03-05 11:48:12
308,515
37
2008-11-21 11:40:57
15,614
2018-03-05 11:48:12
https://stackoverflow.com/q/308491
https://stackoverflow.com/a/308515
<pre><code>hg pull -v </code></pre> <p>-v / --verbose</p> <p>is a global option that applies to all sub-functions. </p> <p>If you want extra data: </p> <pre><code> hg --debug -v pull </code></pre>
<pre><code>hg pull -v </code></pre> <p>-v / --verbose</p> <p>is a global option that applies to all sub-functions. </p> <p>If you want extra data: </p> <pre><code> hg --debug -v pull </code></pre>
456, 802, 4236, 4860, 79778
mercurial, progress-bar, pull, push, version-control
<h1>Show progress of Mercurial push/pull</h1> <p>Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically "no", but does somebody know better? I was expecting something like <code>hg pull -v</code>...</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,964
mercurial
# Show progress of Mercurial push/pull Is it possible to get Mercurial to show progress of long-running push or pull operation? Google tells me basically "no", but does somebody know better? I was expecting something like `hg pull -v`...
``` hg pull -v ``` -v / --verbose is a global option that applies to all sub-functions. If you want extra data: ``` hg --debug -v pull ```
1782095
Does hg pull only operate on the current working directory?
20
2009-11-23 09:43:51
<p>I have multiple mercurial repositories and used <code>hg clone</code> to create backups of them on our file server. Now I want to write a batch file that updates them once a day by running <code>hg pull -u</code> on each subdirectory.</p> <p>I want to keep this backup script as generic as possible, so it should upd...
6,656
113,936
2010-09-09 19:42:31
1,782,125
37
2009-11-23 09:49:02
45,691
2009-11-23 09:49:02
https://stackoverflow.com/q/1782095
https://stackoverflow.com/a/1782125
<p>Use the <code>-R</code>-switch:</p> <pre><code>hg pull -u -R /path/to/repository </code></pre> <p>See <code>hg -v help pull</code> for all command line options of <code>hg pull</code> (the <code>-v</code> switch tells help to include global options).</p>
<p>Use the <code>-R</code>-switch:</p> <pre><code>hg pull -u -R /path/to/repository </code></pre> <p>See <code>hg -v help pull</code> for all command line options of <code>hg pull</code> (the <code>-v</code> switch tells help to include global options).</p>
64, 493, 802, 4860
backup, mercurial, pull, windows
<h1>Does hg pull only operate on the current working directory?</h1> <p>I have multiple mercurial repositories and used <code>hg clone</code> to create backups of them on our file server. Now I want to write a batch file that updates them once a day by running <code>hg pull -u</code> on each subdirectory.</p> <p>I wan...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,966
mercurial
# Does hg pull only operate on the current working directory? I have multiple mercurial repositories and used `hg clone` to create backups of them on our file server. Now I want to write a batch file that updates them once a day by running `hg pull -u` on each subdirectory. I want to keep this backup script as generi...
Use the `-R`-switch: ``` hg pull -u -R /path/to/repository ``` See `hg -v help pull` for all command line options of `hg pull` (the `-v` switch tells help to include global options).
10103227
How do you remove big files from history in mercurial?
35
2012-04-11 09:26:29
<p>I have just created a mercurial repo created from a heterogeneous ecosystems of other repos. Before I publish it to my co-workers, I want to clean it as much as possible. To this end, I'd like to entirely remove a few big old files from history (pretend they never existed), so repo will be smaller.</p> <p>Is this p...
4,789
164,171
2015-03-20 18:41:27
10,106,377
36
2012-04-11 12:58:54
235,698
2012-04-11 13:05:07
https://stackoverflow.com/q/10103227
https://stackoverflow.com/a/10106377
<p>Check out the <code>convert</code> extension, particularly the <code>--filemap</code> option.</p> <p>Enable by adding the following to <code>mercurial.ini</code>:</p> <pre><code>[extensions] convert = </code></pre> <p>Create a map of files to exclude:</p> <pre><code>exclude path/to/file1 exclude path/to/file2 </...
<p>Check out the <code>convert</code> extension, particularly the <code>--filemap</code> option.</p> <p>Enable by adding the following to <code>mercurial.ini</code>:</p> <pre><code>[extensions] convert = </code></pre> <p>Create a map of files to exclude:</p> <pre><code>exclude path/to/file1 exclude path/to/file2 </...
456, 802, 3346
dvcs, mercurial, version-control
<h1>How do you remove big files from history in mercurial?</h1> <p>I have just created a mercurial repo created from a heterogeneous ecosystems of other repos. Before I publish it to my co-workers, I want to clean it as much as possible. To this end, I'd like to entirely remove a few big old files from history (pretend...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,967
mercurial
# How do you remove big files from history in mercurial? I have just created a mercurial repo created from a heterogeneous ecosystems of other repos. Before I publish it to my co-workers, I want to clean it as much as possible. To this end, I'd like to entirely remove a few big old files from history (pretend they nev...
Check out the `convert` extension, particularly the `--filemap` option. Enable by adding the following to `mercurial.ini`: ``` [extensions] convert = ``` Create a map of files to exclude: ``` exclude path/to/file1 exclude path/to/file2 ``` Then convert the repo: ``` hg convert srcrepo destrepo --filemap <map> ```...
2679488
Showing renames in hg status?
32
2010-04-20 23:56:56
<p>I know that Mercurial can track renames of files, but how do I get it to <em>show</em> me renames instead of adds/removes when I do <code>hg status</code>? For instance, instead of:</p> <pre><code>A bin/extract-csv-column.pl A bin/find-mirna-binding.pl A bin/xls2csv-separate-sheets.pl A lib/Text/CSV/Euclid.pm R src...
3,581
125,921
2011-09-23 18:56:21
2,679,722
36
2010-04-21 01:17:11
106,189
2010-04-21 01:17:11
https://stackoverflow.com/q/2679488
https://stackoverflow.com/a/2679722
<p>There are several ways to do this.</p> <p>Before you commit, you can use <code>hg diff --git</code> to show what was renamed:</p> <pre><code>$ hg diff --git diff --git a/theTest.txt b/aTest.txt rename from theTest.txt rename to aTest.txt </code></pre> <p>Note that this only works if you used <code>hg mv</code>, <...
<p>There are several ways to do this.</p> <p>Before you commit, you can use <code>hg diff --git</code> to show what was renamed:</p> <pre><code>$ hg diff --git diff --git a/theTest.txt b/aTest.txt rename from theTest.txt rename to aTest.txt </code></pre> <p>Note that this only works if you used <code>hg mv</code>, <...
802, 3346, 4510
dvcs, mercurial, rename
<h1>Showing renames in hg status?</h1> <p>I know that Mercurial can track renames of files, but how do I get it to <em>show</em> me renames instead of adds/removes when I do <code>hg status</code>? For instance, instead of:</p> <pre><code>A bin/extract-csv-column.pl A bin/find-mirna-binding.pl A bin/xls2csv-separate-s...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,968
mercurial
# Showing renames in hg status? I know that Mercurial can track renames of files, but how do I get it to *show* me renames instead of adds/removes when I do `hg status`? For instance, instead of: ``` A bin/extract-csv-column.pl A bin/find-mirna-binding.pl A bin/xls2csv-separate-sheets.pl A lib/Text/CSV/Euclid.pm R sr...
There are several ways to do this. Before you commit, you can use `hg diff --git` to show what was renamed: ``` $ hg diff --git diff --git a/theTest.txt b/aTest.txt rename from theTest.txt rename to aTest.txt ``` Note that this only works if you used `hg mv`, `hg rename`, or `mv` and `hg addremove --similarity 100`....
5101013
how do you revert 1 or more committed files in mercurial but NOT the entire changeset
31
2011-02-24 06:07:09
<p>Say I have files <code>File_A</code>, <code>File_B</code> and <code>File_C</code>. I edit <code>File_A</code> and <code>File_B</code> on purpose but <code>File_C</code> I just added some debugging code that I don't plan to commit. Then by accident I do a</p> <pre><code>hg commit -m "comment" </code></pre> <p>How d...
34,724
null
2019-09-17 22:05:21
5,105,632
36
2011-02-24 14:03:02
297,645
2018-11-07 22:37:31
https://stackoverflow.com/q/5101013
https://stackoverflow.com/a/5105632
<p>The exact command you wanted to use would have worked if you used <code>hg revert</code> instead of <code>hg update</code></p> <pre><code>hg revert -r .^ File_C hg commit -m "put C back" </code></pre>
<p>The exact command you wanted to use would have worked if you used <code>hg revert</code> instead of <code>hg update</code></p> <pre><code>hg revert -r .^ File_C hg commit -m "put C back" </code></pre>
802
mercurial
<h1>how do you revert 1 or more committed files in mercurial but NOT the entire changeset</h1> <p>Say I have files <code>File_A</code>, <code>File_B</code> and <code>File_C</code>. I edit <code>File_A</code> and <code>File_B</code> on purpose but <code>File_C</code> I just added some debugging code that I don't plan to...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,969
mercurial
# how do you revert 1 or more committed files in mercurial but NOT the entire changeset Say I have files `File_A`, `File_B` and `File_C`. I edit `File_A` and `File_B` on purpose but `File_C` I just added some debugging code that I don't plan to commit. Then by accident I do a ``` hg commit -m "comment" ``` How do ju...
The exact command you wanted to use would have worked if you used `hg revert` instead of `hg update` ``` hg revert -r .^ File_C hg commit -m "put C back" ```
9085668
creating a new branch in mercurial: "abort: push creates new remote head"
28
2012-01-31 19:29:46
<p>I am trying to do something very simple: create a new branch. But I messed up. Where did I make the mistake, and how do I fix it?</p> <p>I am the only user of Mercurial. I had revision 54 committed and pushed to remote repository. I wanted to create a branch based on revision 53, so I updated my local copy to revis...
26,245
336,527
2018-02-22 10:23:57
9,085,762
36
2012-01-31 19:37:43
110,204
2018-02-22 10:23:57
https://stackoverflow.com/q/9085668
https://stackoverflow.com/a/9085762
<p>You tell Mercurial that it can go ahead with</p> <pre><code>$ hg push --force </code></pre> <p>You need to force it since multiple (unnamed) heads are normally discouraged. The problem with them is that people that clone the repository wont know which one to use. But since you're the only user you can just go ahea...
<p>You tell Mercurial that it can go ahead with</p> <pre><code>$ hg push --force </code></pre> <p>You need to force it since multiple (unnamed) heads are normally discouraged. The problem with them is that people that clone the repository wont know which one to use. But since you're the only user you can just go ahea...
802, 1879, 3346
branch, dvcs, mercurial
<h1>creating a new branch in mercurial: "abort: push creates new remote head"</h1> <p>I am trying to do something very simple: create a new branch. But I messed up. Where did I make the mistake, and how do I fix it?</p> <p>I am the only user of Mercurial. I had revision 54 committed and pushed to remote repository. I ...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,971
mercurial
# creating a new branch in mercurial: "abort: push creates new remote head" I am trying to do something very simple: create a new branch. But I messed up. Where did I make the mistake, and how do I fix it? I am the only user of Mercurial. I had revision 54 committed and pushed to remote repository. I wanted to create...
You tell Mercurial that it can go ahead with ``` $ hg push --force ``` You need to force it since multiple (unnamed) heads are normally discouraged. The problem with them is that people that clone the repository wont know which one to use. But since you're the only user you can just go ahead and push. The alternativ...
9810987
After pushing to a review repository, "abort: can't rebase immutable changeset" on rebase
23
2012-03-21 18:52:56
<p>We have a code review repository where people <code>hg push -f</code> all sorts of stuff. After reviews are complete, we pull from the project's central repository, rebase, and push. I recently upgraded to mercurial 2.1 and get this message:</p> <pre><code>abort: can't rebase immutable changeset 43ab8134e7af (see h...
11,925
391,531
2018-10-13 01:17:09
9,810,999
36
2012-03-21 18:53:32
391,531
2017-06-29 12:10:37
https://stackoverflow.com/q/9810987
https://stackoverflow.com/a/9810999
<p>In the review repository's .hg/hgrc file, add these lines:</p> <pre><code>[phases] publish = False </code></pre> <p>The problem is due to a new feature in mercurial 2.1 called <a href="https://www.mercurial-scm.org/wiki/Phases" rel="nofollow noreferrer">phases</a>. It's great. <a href="http://www.logilab.org/bloge...
<p>In the review repository's .hg/hgrc file, add these lines:</p> <pre><code>[phases] publish = False </code></pre> <p>The problem is due to a new feature in mercurial 2.1 called <a href="https://www.mercurial-scm.org/wiki/Phases" rel="nofollow noreferrer">phases</a>. It's great. <a href="http://www.logilab.org/bloge...
802, 77625
mercurial, mercurial-phases
<h1>After pushing to a review repository, "abort: can't rebase immutable changeset" on rebase</h1> <p>We have a code review repository where people <code>hg push -f</code> all sorts of stuff. After reviews are complete, we pull from the project's central repository, rebase, and push. I recently upgraded to mercurial 2....
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,972
mercurial
# After pushing to a review repository, "abort: can't rebase immutable changeset" on rebase We have a code review repository where people `hg push -f` all sorts of stuff. After reviews are complete, we pull from the project's central repository, rebase, and push. I recently upgraded to mercurial 2.1 and get this messa...
In the review repository's .hg/hgrc file, add these lines: ``` [phases] publish = False ``` The problem is due to a new feature in mercurial 2.1 called [phases](https://www.mercurial-scm.org/wiki/Phases). It's great. [Here](http://www.logilab.org/blogentry/88203) is a nice introduction to its use. To make the change...
8001105
taking uncommitted changes on the wrong branch to the right branch
16
2011-11-03 20:02:19
<p>I am using Mercurial.</p> <p>I have some uncommitted changes but I am on the wrong branch, how do I update to the right branch and take the changes with me?</p>
4,018
16,998
2017-06-08 20:34:45
8,025,140
36
2011-11-06 03:55:23
781,517
2017-06-08 20:34:45
https://stackoverflow.com/q/8001105
https://stackoverflow.com/a/8025140
<p>For uncommited changes you can use the <a href="https://www.mercurial-scm.org/wiki/ShelveExtension" rel="noreferrer">Shelve extension</a>:</p> <ol> <li><code>hg shelve --all</code></li> <li><code>hg up correct_branch_name</code></li> <li><code>hg unshelve</code></li> </ol>
<p>For uncommited changes you can use the <a href="https://www.mercurial-scm.org/wiki/ShelveExtension" rel="noreferrer">Shelve extension</a>:</p> <ol> <li><code>hg shelve --all</code></li> <li><code>hg up correct_branch_name</code></li> <li><code>hg unshelve</code></li> </ol>
802
mercurial
<h1>taking uncommitted changes on the wrong branch to the right branch</h1> <p>I am using Mercurial.</p> <p>I have some uncommitted changes but I am on the wrong branch, how do I update to the right branch and take the changes with me?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,973
mercurial
# taking uncommitted changes on the wrong branch to the right branch I am using Mercurial. I have some uncommitted changes but I am on the wrong branch, how do I update to the right branch and take the changes with me?
For uncommited changes you can use the [Shelve extension](https://www.mercurial-scm.org/wiki/ShelveExtension): 1. `hg shelve --all` 2. `hg up correct_branch_name` 3. `hg unshelve`
2550721
Examining a single changeset in Mercurial
45
2010-03-31 05:34:40
<p>In Mercurial, how do you examine a single changeset? hg log -l 5 will give me a summary of the newest 5 changesets, but how do I get a list of the files changed in one changeset? I don't want to do a diff.</p>
24,954
84,952
2024-01-31 05:21:56
2,550,958
35
2010-03-31 06:45:56
190,201
2010-03-31 06:45:56
https://stackoverflow.com/q/2550721
https://stackoverflow.com/a/2550958
<p>Pass -v to log and it will print out additional information, including a list of files changed.</p> <p>Example:</p> <pre><code>hg log -v -r&lt;rev&gt; | grep ^files </code></pre>
<p>Pass -v to log and it will print out additional information, including a list of files changed.</p> <p>Example:</p> <pre><code>hg log -v -r&lt;rev&gt; | grep ^files </code></pre>
802
mercurial
<h1>Examining a single changeset in Mercurial</h1> <p>In Mercurial, how do you examine a single changeset? hg log -l 5 will give me a summary of the newest 5 changesets, but how do I get a list of the files changed in one changeset? I don't want to do a diff.</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,974
mercurial
# Examining a single changeset in Mercurial In Mercurial, how do you examine a single changeset? hg log -l 5 will give me a summary of the newest 5 changesets, but how do I get a list of the files changed in one changeset? I don't want to do a diff.
Pass -v to log and it will print out additional information, including a list of files changed. Example: ``` hg log -v -r<rev> | grep ^files ```
5098085
How (is it possible) to create an hg command alias that runs multiple commands?
35
2011-02-23 22:33:22
<p>I would like to define a Mercurial command alias in my hgrc file that invokes multiple commands. For example I would like to do something like the following:</p> <pre><code>[alias] giveup = revert --all --no-backup; purge syncprod = fetch production; push production </code></pre> <p>This would allow me to call <co...
6,553
540,663
2023-07-05 20:01:41
5,098,344
35
2011-02-23 22:58:00
8,992
2012-09-28 15:20:55
https://stackoverflow.com/q/5098085
https://stackoverflow.com/a/5098344
<p>Use the shell alias style like this:</p> <pre><code>giveup = !$HG revert --all --no-backup ; $HG purge </code></pre> <p>Though, personally I'd just create a bash alias for those so I could skip the <code>hg</code> part altogether.</p>
<p>Use the shell alias style like this:</p> <pre><code>giveup = !$HG revert --all --no-backup ; $HG purge </code></pre> <p>Though, personally I'd just create a bash alias for those so I could skip the <code>hg</code> part altogether.</p>
802
mercurial
<h1>How (is it possible) to create an hg command alias that runs multiple commands?</h1> <p>I would like to define a Mercurial command alias in my hgrc file that invokes multiple commands. For example I would like to do something like the following:</p> <pre><code>[alias] giveup = revert --all --no-backup; purge syncp...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,975
mercurial
# How (is it possible) to create an hg command alias that runs multiple commands? I would like to define a Mercurial command alias in my hgrc file that invokes multiple commands. For example I would like to do something like the following: ``` [alias] giveup = revert --all --no-backup; purge syncprod = fetch producti...
Use the shell alias style like this: ``` giveup = !$HG revert --all --no-backup ; $HG purge ``` Though, personally I'd just create a bash alias for those so I could skip the `hg` part altogether.
9051190
hg - Ignore directory at root only
32
2012-01-29 05:36:22
<p>In my project's <code>.hgignore</code>, I want to exclude <code>/static/</code> (i.e., the static folder at the root of the directory), but not <code>/templates/static/</code>. How would I configure <code>.hgignore</code> to allow this?</p>
4,906
566,179
2019-03-13 16:01:02
9,051,271
35
2012-01-29 05:58:08
1,152,915
2012-02-10 15:41:59
https://stackoverflow.com/q/9051190
https://stackoverflow.com/a/9051271
<p>You can include <code>syntax: regexp</code> at the beginning of .hgignore and then use perl regex syntax to root a directory by using <code>^</code>. So just <code>^static</code> should do the work.</p>
<p>You can include <code>syntax: regexp</code> at the beginning of .hgignore and then use perl regex syntax to root a directory by using <code>^</code>. So just <code>^static</code> should do the work.</p>
802, 31419
hgignore, mercurial
<h1>hg - Ignore directory at root only</h1> <p>In my project's <code>.hgignore</code>, I want to exclude <code>/static/</code> (i.e., the static folder at the root of the directory), but not <code>/templates/static/</code>. How would I configure <code>.hgignore</code> to allow this?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,976
mercurial
# hg - Ignore directory at root only In my project's `.hgignore`, I want to exclude `/static/` (i.e., the static folder at the root of the directory), but not `/templates/static/`. How would I configure `.hgignore` to allow this?
You can include `syntax: regexp` at the beginning of .hgignore and then use perl regex syntax to root a directory by using `^`. So just `^static` should do the work.
10435591
HG: find where a deleted line was removed
31
2012-05-03 16:33:24
<p>I am looking for the mercurial equivalent of the solution to this question:</p> <p><a href="https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line">How do I &quot;git blame&quot; a deleted line?</a></p> <p>In short, I am looking at a mercurial commit where a line was added, and in the current re...
4,413
610,585
2023-04-19 18:07:46
10,485,846
35
2012-05-07 16:44:53
610,585
2023-04-19 18:07:46
https://stackoverflow.com/q/10435591
https://stackoverflow.com/a/10485846
<p><code>hg histgrep </code> will let you search a change log for a pattern, such as a deleted string. If you are looking for more than just the first occurrence, be sure to include the <code>--all</code> flag. For me it looked something like this:</p> <p><code>hg histgrep --all -r 9876:tip &quot;pattern&quot; path/t...
<p><code>hg histgrep </code> will let you search a change log for a pattern, such as a deleted string. If you are looking for more than just the first occurrence, be sure to include the <code>--all</code> flag. For me it looked something like this:</p> <p><code>hg histgrep --all -r 9876:tip &quot;pattern&quot; path/t...
802, 21455
blame, mercurial
<h1>HG: find where a deleted line was removed</h1> <p>I am looking for the mercurial equivalent of the solution to this question:</p> <p><a href="https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line">How do I &quot;git blame&quot; a deleted line?</a></p> <p>In short, I am looking at a mercurial c...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,978
mercurial
# HG: find where a deleted line was removed I am looking for the mercurial equivalent of the solution to this question: [How do I "git blame" a deleted line?](https://stackoverflow.com/questions/4404444/how-do-i-blame-a-deleted-line) In short, I am looking at a mercurial commit where a line was added, and in the cur...
`hg histgrep` will let you search a change log for a pattern, such as a deleted string. If you are looking for more than just the first occurrence, be sure to include the `--all` flag. For me it looked something like this: `hg histgrep --all -r 9876:tip "pattern" path/to/file` Thanks to Anton for the helpful comment...
3975164
How can I use vim not vi to write commit message?
31
2010-10-20 06:10:58
<p>When I do hg commit, it use vi as my default editor, how to change it to vim?</p>
16,149
443,966
2017-05-31 11:46:44
3,975,187
35
2010-10-20 06:15:25
223,806
2017-05-31 11:45:47
https://stackoverflow.com/q/3975164
https://stackoverflow.com/a/3975187
<p>From the <a href="https://www.mercurial-scm.org/wiki/editor" rel="noreferrer">editor docs</a>:</p> <blockquote> <p>Mercurial tries to pick which program to call to edit a commit message by trying the following (in order):</p> <ol> <li>HGEDITOR environment variable</li> <li>editor configuration option...
<p>From the <a href="https://www.mercurial-scm.org/wiki/editor" rel="noreferrer">editor docs</a>:</p> <blockquote> <p>Mercurial tries to pick which program to call to edit a commit message by trying the following (in order):</p> <ol> <li>HGEDITOR environment variable</li> <li>editor configuration option...
802
mercurial
<h1>How can I use vim not vi to write commit message?</h1> <p>When I do hg commit, it use vi as my default editor, how to change it to vim?</p>
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,979
mercurial
# How can I use vim not vi to write commit message? When I do hg commit, it use vi as my default editor, how to change it to vim?
From the [editor docs](https://www.mercurial-scm.org/wiki/editor): > Mercurial tries to pick which program > to call to edit a commit message by > trying the following (in order): > > 1. HGEDITOR environment variable > 2. editor configuration option in [ui] section (in hgrc or passed with > --config ui.editor comma...
5159284
What does this symbol mean in Mercurial?
26
2011-03-01 19:23:49
<p><img src="https://i.sstatic.net/6Epux.jpg" alt="enter image description here"></p> <p>I've majorly refactored my project. I've added some new classes, but I've also RightClick > Deleted classes from within Visual Studio Solution Explorer.</p> <p>What does the ! symbol mean?</p> <p>All of the items marked with ! w...
17,094
null
2011-03-01 20:13:29
5,159,372
35
2011-03-01 19:32:29
439,317
2011-03-01 19:32:29
https://stackoverflow.com/q/5159284
https://stackoverflow.com/a/5159372
<p>Those files are "missing." You haven't explicitly removed those files from the repository, and yet mercurial can't find them.</p> <p>If you commit with <code>hg commit --addremove</code> then mercurial will remove all of the missing files from the repository. In this case, I think this is what you want to do - yo...
<p>Those files are "missing." You haven't explicitly removed those files from the repository, and yet mercurial can't find them.</p> <p>If you commit with <code>hg commit --addremove</code> then mercurial will remove all of the missing files from the repository. In this case, I think this is what you want to do - yo...
802
mercurial
<h1>What does this symbol mean in Mercurial?</h1> <p><img src="https://i.sstatic.net/6Epux.jpg" alt="enter image description here"></p> <p>I've majorly refactored my project. I've added some new classes, but I've also RightClick > Deleted classes from within Visual Studio Solution Explorer.</p> <p>What does the ! sym...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,981
mercurial
# What does this symbol mean in Mercurial? ![enter image description here](https://i.sstatic.net/6Epux.jpg) I've majorly refactored my project. I've added some new classes, but I've also RightClick > Deleted classes from within Visual Studio Solution Explorer. What does the ! symbol mean? All of the items marked wi...
Those files are "missing." You haven't explicitly removed those files from the repository, and yet mercurial can't find them. If you commit with `hg commit --addremove` then mercurial will remove all of the missing files from the repository. In this case, I think this is what you want to do - you've purposely deleted ...
4791811
Mercurial: Create a branch without having to make a change first
26
2011-01-25 09:34:16
<p>I heard that the only way to create a branch in a Mercurial repository is to make changes in the working copy, then commit them to a new branch.</p> <p>In Subversion, I can create a branch without having to make changes (by copying <code>trunk</code> to a path under <code>tags</code>) - is it possible to do this in...
18,034
26,414
2016-06-10 08:50:34
4,792,040
35
2011-01-25 09:56:12
267
2011-01-25 10:17:43
https://stackoverflow.com/q/4791811
https://stackoverflow.com/a/4792040
<p>It depends on what you mean by branch.</p> <p>A named branch can be created by giving it a name and then committing, it'll end up as a new changeset in the history, but you don't need to explicitly change any of the files in the working folder to be allowed to commit.</p> <pre><code>hg branch NEWNAME hg commit -m ...
<p>It depends on what you mean by branch.</p> <p>A named branch can be created by giving it a name and then committing, it'll end up as a new changeset in the history, but you don't need to explicitly change any of the files in the working folder to be allowed to commit.</p> <pre><code>hg branch NEWNAME hg commit -m ...
456, 802, 8122, 53847
branching-and-merging, mercurial, tortoisehg, version-control
<h1>Mercurial: Create a branch without having to make a change first</h1> <p>I heard that the only way to create a branch in a Mercurial repository is to make changes in the working copy, then commit them to a new branch.</p> <p>In Subversion, I can create a branch without having to make changes (by copying <code>trun...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,982
mercurial
# Mercurial: Create a branch without having to make a change first I heard that the only way to create a branch in a Mercurial repository is to make changes in the working copy, then commit them to a new branch. In Subversion, I can create a branch without having to make changes (by copying `trunk` to a path under `t...
It depends on what you mean by branch. A named branch can be created by giving it a name and then committing, it'll end up as a new changeset in the history, but you don't need to explicitly change any of the files in the working folder to be allowed to commit. ``` hg branch NEWNAME hg commit -m "Created branch NEWNA...
19820020
hg remove all files listed in .hgignore
18
2013-11-06 18:35:28
<p>I have a mercurial repo with <code>.hgignore</code> file. I want to remove all files from disk (<code>hg remove</code>) in this repo which match pattern(s) listed in <code>.hgignore</code>.</p> <p>I can list all ignored files with <code>hg status -i</code> but I don't know how can I delete them.</p> <p>.hgignore c...
5,688
355,507
2018-02-22 10:27:37
19,826,709
35
2013-11-07 02:09:23
110,204
2018-02-22 10:27:37
https://stackoverflow.com/q/19820020
https://stackoverflow.com/a/19826709
<p>You can only run <code>hg remove</code> on files that are tracked. To remove tracked files that match the <code>.hgignore</code> patterns, run this command</p> <pre><code>$ hg forget "set:hgignore() and not ignored()" </code></pre> <p>This uses a <a href="http://www.selenic.com/mercurial/hg.1.html#fileset" rel="no...
<p>You can only run <code>hg remove</code> on files that are tracked. To remove tracked files that match the <code>.hgignore</code> patterns, run this command</p> <pre><code>$ hg forget "set:hgignore() and not ignored()" </code></pre> <p>This uses a <a href="http://www.selenic.com/mercurial/hg.1.html#fileset" rel="no...
802, 97185
mercurial, ubuntu-13.10
<h1>hg remove all files listed in .hgignore</h1> <p>I have a mercurial repo with <code>.hgignore</code> file. I want to remove all files from disk (<code>hg remove</code>) in this repo which match pattern(s) listed in <code>.hgignore</code>.</p> <p>I can list all ignored files with <code>hg status -i</code> but I don'...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,983
mercurial
# hg remove all files listed in .hgignore I have a mercurial repo with `.hgignore` file. I want to remove all files from disk (`hg remove`) in this repo which match pattern(s) listed in `.hgignore`. I can list all ignored files with `hg status -i` but I don't know how can I delete them. .hgignore contents: ``` synt...
You can only run `hg remove` on files that are tracked. To remove tracked files that match the `.hgignore` patterns, run this command ``` $ hg forget "set:hgignore() and not ignored()" ``` This uses a [fileset](http://www.selenic.com/mercurial/hg.1.html#fileset) to select the right files. If you want to remove files...
7764914
hg equivalent of git add -p?
48
2011-10-14 08:22:03
<p>Is there a mercurial equivalent of <code>git add -p</code>?</p> <p>Quoting from man, git-add with the option -p (or --patch) does the following:</p> <blockquote> <p>Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the di...
8,992
877,377
2019-04-17 12:00:44
7,767,133
34
2011-10-14 11:45:12
256,362
2016-07-12 12:56:45
https://stackoverflow.com/q/7764914
https://stackoverflow.com/a/7767133
<p>Have a look at the <a href="https://www.mercurial-scm.org/wiki/RecordExtension" rel="nofollow">record extension</a> (which comes bundled with Mercurial).</p> <p>Note that since Mercurial doesn't have the concept of the staging area like git, running <code>hg record</code> will simply allow you to examine, hunk by h...
<p>Have a look at the <a href="https://www.mercurial-scm.org/wiki/RecordExtension" rel="nofollow">record extension</a> (which comes bundled with Mercurial).</p> <p>Note that since Mercurial doesn't have the concept of the staging area like git, running <code>hg record</code> will simply allow you to examine, hunk by h...
119, 802, 34792
git, git-add, mercurial
<h1>hg equivalent of git add -p?</h1> <p>Is there a mercurial equivalent of <code>git add -p</code>?</p> <p>Quoting from man, git-add with the option -p (or --patch) does the following:</p> <blockquote> <p>Interactively choose hunks of patch between the index and the work tree and add them to the index. This give...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,984
mercurial
# hg equivalent of git add -p? Is there a mercurial equivalent of `git add -p`? Quoting from man, git-add with the option -p (or --patch) does the following: > Interactively choose hunks of patch between the index and the work > tree and add them to the index. This gives the user a chance to > review the difference ...
Have a look at the [record extension](https://www.mercurial-scm.org/wiki/RecordExtension) (which comes bundled with Mercurial). Note that since Mercurial doesn't have the concept of the staging area like git, running `hg record` will simply allow you to examine, hunk by hunk, the modifications in your working copy. An...
5264528
Why 'hg mv' (mercurial) doesn't move a file's history by default?
40
2011-03-10 19:07:17
<p>I know <a href="https://stackoverflow.com/questions/3472216/in-mercurial-hg-rename-works-but-the-history-doesnt-follow-the-file">how to do it</a>, I just can't understand why <code>hg mv</code> doesn't move the file's history as well by default.</p> <p>It really seems silly to be obligated me to run <code>hg log --...
14,343
198,553
2014-08-26 06:15:54
5,264,567
34
2011-03-10 19:10:34
613,130
2014-08-26 06:15:54
https://stackoverflow.com/q/5264528
https://stackoverflow.com/a/5264567
<p>You can can change the default behaviour of log: in your ~/.hgrc (or somewhere/Mercurial.ini), add </p> <pre><code>[alias] log = log -f </code></pre> <p>I've read the appearance of the log is for speed reason. Move isn't truly a "first level" operation in Mercurial. It's a copy + delete (this compared to Bazaar ...
<p>You can can change the default behaviour of log: in your ~/.hgrc (or somewhere/Mercurial.ini), add </p> <pre><code>[alias] log = log -f </code></pre> <p>I've read the appearance of the log is for speed reason. Move isn't truly a "first level" operation in Mercurial. It's a copy + delete (this compared to Bazaar ...
456, 802
mercurial, version-control
<h1>Why 'hg mv' (mercurial) doesn't move a file's history by default?</h1> <p>I know <a href="https://stackoverflow.com/questions/3472216/in-mercurial-hg-rename-works-but-the-history-doesnt-follow-the-file">how to do it</a>, I just can't understand why <code>hg mv</code> doesn't move the file's history as well by defau...
q.PostTypeId = 1; a.PostTypeId = 2; EXISTS tag '%mercurial%' OR '%hg%'; a.Body contains code block; q.Score > 5; a.Score > 10
23,985
mercurial
# Why 'hg mv' (mercurial) doesn't move a file's history by default? I know [how to do it](https://stackoverflow.com/questions/3472216/in-mercurial-hg-rename-works-but-the-history-doesnt-follow-the-file), I just can't understand why `hg mv` doesn't move the file's history as well by default. It really seems silly to b...
You can can change the default behaviour of log: in your ~/.hgrc (or somewhere/Mercurial.ini), add ``` [alias] log = log -f ``` I've read the appearance of the log is for speed reason. Move isn't truly a "first level" operation in Mercurial. It's a copy + delete (this compared to Bazaar where the move/rename is a "f...