Please help me merge the heads that I didn't want in the first place:
C:\Users\hg\>hg push
pushing to https://usernm#bitbucket.org/zzz/yyy
http authorization required
realm: Bitbucket.org HTTP
user:
password:
searching for changes
abort: push creates new remote head 841acfa3a36b!
(merge or see "hg help push" for details about pushing new heads)
C:\Users\hg\m>hg merge
abort: uncommitted changes
(use 'hg status' to list changes)
C:\Users\hg\>
C:\Users\hg>hg commit -m " merge"
nothing changed (12 missing files, see 'hg status')
C:\Users\hg\>hg status
! montaoproject\common\__init__.pyc
! montaoproject\common\templatefilters.pyc
! montaoproject\conf\__init__.pyc
! montaoproject\conf\settings.pyc
! montaoproject\static\img\github.png
! montaoproject\static\img\index_in2.png
! montaoproject\static\img\openid.png
! montaoproject\static\pakistan-reg_files\wikimedia-button.png
! montaoproject\wtforms\ext\__init__.pyc
! montaoproject\wtforms\ext\appengine\__init__.pyc
! montaoproject\wtforms\ext\appengine\db.pyc
! montaoproject\wtforms\ext\appengine\fields.pyc
? .idea\.name
outstanding uncommitted changes in repository C:/Users/hg/, not merging with pulled head
abort: uncommitted changes
Tells you in clean English: you must commit before merge
Try this:
hg push -f -r Number_Rev
I push in our repository more big video files, my fault, I did not notice them and forgot to add the folder with the video to ignore file. Now my friends can not upgrade because a shortage of memory (abort: out of memory). How do I remove a video from the master repository? I tried to just delete the folder with the video in /home/hg/project/.hg/ But then do not start updating with an error. Help me pliz and sorry for my english/
See the Mercurial FAQ:
4.14. I committed a change containing nuclear launch codes, how do I delete it permanently?
4.15. I committed a large binary file/files, how do I delete them permanently?
There are some options described on the Editing History page as well.
You:
$ hg rm video.ogv
$ hg ci -m "removed video.ogv"
Other:
$ hg pull your-repository
$ hg update
The HG FAQ merely gives a few vague pointers. Here's how to do it:
Add to your .hgrc:
[extensions]
hgext.convert=
[convert]
hg.saverev=false
Create a filemap of what files you want to remove (myfilemap)
exclude "relative/path/to/file.mp4"
Use hg convert to make a new repo
hg convert --filemap myfilemap myrepo myrepo.new
Now you have the new repo without the excluded files.
I just opened up a project that had the .hgignore file set up entirely wrong. I have fixed it to what it should be, and now I have to remove all the stuff that it was previously not ignoring and now should. Maybe its just early in the morning, but any way to do that other than manually?
(requires Mercurial >= 1.9)
$ hg forget "set:hgignore() and not ignored()"
see hg help filesets for more
I have a file foo.py with some history. I want to rename it bar.py but see the history with "hg log".
I tried "hg rename". It does not seem to maintain the history.
FYI. I only browsed the man page.
Thanks in advance!
Thanks for the answer.
As an addendum, if foo.py is 500 KB, will a rename increase the size of the repository by at least 500 KB? Is there any way where it can not do this and simply store a name mapping?
Use hg log --follow. From hg help log:
-f --follow follow changeset history, or file history across copies and renames
I'm using Mercurial. I made a clone of a repository. For debugging, I changed a few lines of code in a java file. I did not commit those changes though. I just want to revert them back to their original state, as found in the repository. I tried hg revert filename.java, which did revert it, but now when I do hg status, I see additional files added in my folder now like:
? filename.java.orig
Can I just delete those files, and why does Mercurial make them when I use revert?
You can also use the flag --no-backup and the .orig files will not be created
hg revert --no-backup filename.java
As of Mercurial 2.0, you can instead use the flag -C to supress the .orig files from being created
hg revert -C filename.java
Yes, you can delete them. It's a safety feature in case you reverted something you didn't mean to revert.
I find the purge extension handy. Usage:
hg purge
"This extension purges all files and directories not being tracked by
Mercurial"
...including the .orig files but excluding ignored files (unless you use --all).
As other's have pointed out, you can safely delete these files.
You can remove them by executing this command from the root of your repo:
rm `hg st -un | grep orig`
If you want to revert, and don't care at all about backing up the original files, the command you want is:
hg update -C
Those are copies of the files from before you reverted them. If you don't need those, you can delete them, either by hand or by using the Purge extension:
hg clean
These backup files can be created for merge and revert operations (cf. man page). You can add an ignore rule if you want, or simply delete them if you don't need them anymore.
These are rather common, resulting from various operations. A glance at one of the moderate sized repositories I work on finds 237 of them. I don't like deleting things that may end up being useful, and I have no reason to name legitimate files with the same suffix, so I add the following to .hgignore instead:
.\.orig$
I made this batch file myself.
IF "%1%" == "d" (
del /s *.orig
del /s *.rej
) ELSE (
del /s /p *.rej
del /s /p *.orig
)
Help:
Save this content as orig.bat
Run orig d to delete all rejects and orig files at once without confirmation
Run orig to delete files with confirmation [Safety mechanism]
Hope this is helpful.