This .hgignore doesn't seem to be working for me. The glob files are ignored but not the things specified in the subincludes:
subinclude:SDK.Workspace/.hgignore
subinclude:SDK.Workspace/Application/.hgignore
syntax: glob
*.pyc
*.o
*.d
Is it not supported in this version? I'm using Ubuntu 14.04.
$ hg --version
Mercurial Distributed SCM (version 3.0.1)
Directory: ~/Development/CCL/SDK.Workspace
$ cat .hgignore
Application.BSP
Hardware
webtalk
SDK.log
RemoteSystemsTempFiles
.metadata
Directory: ~/Development/CCL/SDK.Workspace
$ hg status Hardware
? Hardware/.project
? Hardware/fmm_c5_mb.bit
? Hardware/fmm_c5_mb_bd.bmm
? Hardware/ps7_init.c
? Hardware/ps7_init.h
? Hardware/ps7_init.html
? Hardware/ps7_init.tcl
? Hardware/system.hdf
Your version is simply not recent enough. The subinclude feature was introduced in Mercurial v3.5.
Related
I'm trying to do a hg clone on an Internet facing machine for later use on an offline build machine. Unfortunately mercurial is 3.9.1 on the Internet machine, but 1.4 on the offline machine.
I get the error abort: requirement 'generaldelta' not supported! and also abort: requirement 'dotencode' not supported!
I found this is becuase generaldelta feature was added in 1.9, and dotencode in 1.7. I've used instructions from the MissingRequirement wiki page to downgrade this repo using the following.
hg clone -U --config format.generaldelta=0 --config format.dotencode=0 --pull /tmp/foo /tmp/bar
However the new repo at /tmp/bar still uses generaldelta, although dotencode require has gone. i.e.
cat /tmp/bar/.hg/requires
fncache
generaldelta <=== still there
revlogv1
store
store
How can I rewrite the repo with both generaldelta and dotencode disabled?
The config option should have been format.usegeneraldelta not format.generaldelta. i.e.
hg clone -U --config format.usegeneraldelta=0 --config format.dotencode=0 --pull /tmp/foo /tmp/bar
Note the config. options are all config.use<feature-name> apart from config.dotencode see Mercurial format options. Beware as there is not any error checking either.
Is there a way for running mercurial without any external extension using a command line switch / environment variable?
For example, in this situation:
$ hg version --debug
Mercurial Distributed SCM (version 4.3.3)
[...]
Enabled extensions:
hggit external
hgremotebranches external
mq internal
rebase internal
shelve internal
How can I accomplish:
$ hg --disable-all-extensions version --debug
Mercurial Distributed SCM (version 4.3.3)
[...]
Enabled extensions:
<empty>
I know I can disable individual extensions via --config extensions.name=!, but I need to nuke everything at once.
From hg help environment:
HGRCPATH
A list of files or directories to search for configuration files. Item
separator is ":" on Unix, ";" on Windows. If HGRCPATH is not set,
platform default search path is used. If empty, only the .hg/hgrc from
the current repository is read.
So you can do:
HGRCPATH= hg version --debug
The mercurial developers encourage everyone to use this incantation in scripts to avoid having the meaning of mercurial commands depend on a user's configuration. See http://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/automation.html for more information from Mozilla about automating mercurial.
I am in my first days of Mercurial, I did my google homework, but I can't find a solution to this.
Here is the output from the server which should explain things better than I could:
david#triton:~/www/triton$ ls -l -a | grep .hg
drwxr-xr-x 4 david david 4096 2011-11-19 17:44 .hg
-rw-r--r-- 1 david david 0 2011-11-18 22:23 .hgignore
david#triton:~/www/triton$ hg init
abort: repository . already exists!
david#triton:~/www/triton$ hg serve
abort: There is no Mercurial repository here (.hg not found)!
I am trying to push from tortiseHG on a windows client to this server but it too is complaining about there being no repo.
What the heck, guys?
hg init is just checking if a .hg directory already exists, which it clearly does. Try
$ ls -l .hg
ls: cannot access .hg: No such file or directory
$ mkdir .hg
$ hg init
abort: repository . already exists!
How did that .hg directory get there? If you created it yourself, you shouldn't have. You should have let hg init create it as it puts a lot of other stuff in there. What output do you get from hg summary?
This could happen if the versions of mercurial differ between server and client. In that case you'll have to convert the repo to the older version (or upgrade your client to the server version) in order to fix the issue. HTH!
If you run a hg stat or hg summary like R4yan said, you might see a more helpful error message. If it's a difference in version you might see something like: 'abort: requirement 'dotencode' not supported!'
If you do hg log myfile -v you see a list of changesets that the file was modified in.
In our case, in the most recent changeset, the file was removed. But you can't tell this by looking at the verbose (-v) output of hg log. Is there an easy Mercurial command you can use to determine if and when a file has been removed from the repo?
Update: Note that this is on a Windows client, and we are using Mercurial v 1.4.3
Update 2: Appears the answers below would work with a more recent version of Mercurial, however an upgrade isn't in the cards right now. Any other ideas for v 1.4.3 ???
You can check which revision deleted a file (any many other interesting features) using revsets:
hg log -r 'removes(<myfile>)'
Some examples:
hg log -r 'removes(build.xml)' // where build.xml used to be in the current directory
hg log -r 'removes("**/build.xml")' // where build.xml may have been in sub directories
See hg help revsets for details.
The --removed flag should get you what you are looking for:
hg log myfile -v --removed
From the help for hg log:
--removed include revisions where files were removed
This is what I use to list all the deleted files in my repository:
hg log --template "{rev}: {file_dels}\n" | grep -v ':\s*$'
I am working on a system that performs continuous integration and I am looking for a method I can use to get the most recent changeset from a Mercurial repository without creating a repository locally.
I have considered using clone but this method will only work if you have set a working directory locally (since this will be occurring on a build server, I would prefer not to do this because of inclusion of the .hg file and the diffs - all I want is essentially an export of the files from the tip revision and nothing more.)
This request may not even be possible, and it's very likely that I just do not understand DVCS very well. However, if I cannot do what I want to do, is there a workaround?
It's possible using 'hg archive' depending how your remote repository is set up.
If it's available over HTTP using hgweb.cgi or hg serve you can hit the archive link programmatically to get the files you want. Example:
wget https://www.mercurial-scm.org/repo/hg/archive/tip.zip --output-document=- | unzip -
or it's available over ssh:
ssh you#there.com hg archive --type=zip - | unzip -
You can use:
$ hg clone http://your_repo
$ hg archive ../export/
$ rm -rf *
$ cd ..
$ cd export
From Mercurial's help files:
$ hg help archive
hg archive [OPTION]... DEST
create an unversioned archive of a
repository revision
You can use:
http://merc/raw-file
to retrieve a list of files in the repository or
http://merc/raw-file/filename
to get a specific file.