hg shelve installed but hg: unknown command 'unshelve' - mercurial

I installed the shelve extension for hg by adding 'shelve=' to [extensions]. I can verify this by running 'hg help extensions' which has the following in the output:
enabled extensions:
extdiff command to allow external programs to compare revisions
fetch pull, update and merge in one command
shelve Manage shelves of pickled objects.
I then type 'hg shelve' in a repo of mine, and I get:
hg: unknown command 'shelve'
Mercurial Distributed SCM
...
I would expect the shelve extension to run...
Mercurial verison is 2.0.2

The Shelve extension is distributed with Mercurial 2.8 and later, as mentioned here.
There is an older third party shelve extension that you can use with Mercurial 2.0.2, but it is not distributed with Mercurial and must be installed separately.

Related

Re-cloning a mercurial repository without generaldelta

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.

mercurial : disable all the extensions from the command line

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.

How to reset a TeamCity build after stripping Hg changesets?

I recently needed to strip some changesets from my Mercurial repository. I then tried to run a build from TeamCity but got the following error message:
[09:44:25]: Updating sources: agent side checkout... (16s)
[09:44:42]: [Updating sources: agent side checkout...] Failed to perform checkout on agent: 'cmd /c hg update -C -r 507b8c8f4cdb' command failed. stderr: abort: unknown revision '507b8c8f4cdb'!
The error makes sense since the changeset no longer exists in the repo, but I don't know how to reset TeamCity to pull from the new tip. I'm guessing that I could copy the TeamCity build configuration to a new build, but then I'd lose my history.
Is this possible? Or have I corrupted my TeamCity build and need to start up a new one?
Add a new commit to the repository so that the tip revision gets updated.

Mercurial Newbie confused

I am familiar with TFS and Vault, but having just started using Mercurial I seem to be getting into a bit of a mess.
Heres what I (think) I've done:
-Created a central repository on bitbucket.org
-On my desktop PC, cloned repository from bitbucket, added files, commit them, push them to bitbucket
-On my laptop, cloned repository from bitbucket, pulled files, added more files, commit them, push them to bitbucket
I've continued to add, edit etc on the different computers.
Now I've noticed that some files from each computer are not in the bitbucket repository, and therefore only in the local repository. No amount of pulling and pushing seems to get it into the bitbucket repository.
What is the most likely thing I've done wrong?
Is there a way to 'force' by changes up to the bitbucket repository?
Did they get into your local repository? I suspect not, i.e. they were new files that were not added to the commit. Use hg add to add them to the changeset before committing or whatever the equivalent is for whatever mercurial interface you're using.
Edit:
Here's the help from Mercurial:
C:\Users\Bert>hg add --help
hg add [OPTION]... [FILE]...
add the specified files on the next commit
Schedule files to be version controlled and added to the repository.
The files will be added to the repository at the next commit. To undo an
add before that, see "hg forget".
If no names are given, add all files to the repository.
...
See Mercurial: The Definitive Guide (a.k.a. the hg "red book") for more info:
http://hgbook.red-bean.com/read/mercurial-in-daily-use.html
Telling Mercurial which files to track
Mercurial does not work with files in your repository unless you tell it to manage them. The hg status command will tell you which files Mercurial doesn't know about; it uses a “?” to display such files.
To tell Mercurial to track a file, use the hg add command. Once you have added a file, the entry in the output of hg status for that file changes from “?” to “A”.
$ hg init add-example
$ cd add-example
$ echo a > myfile.txt
$ hg status
? myfile.txt
$ hg add myfile.txt
$ hg status
A myfile.txt
$ hg commit -m 'Added one file'
$ hg status
use "hg -v help add" to show global options

Review Board extension for mercurial not working on a Windows machine

I have installed mercurial and review board extension for mercurial on my Windows XP machine. In review board, I have added a repository say "MyRepo" which is on a central server.
I cloned "MyRepo" to my local machine, modified a file for testing and committed to my local repo. I haven't yet pushed it to my central repo.
Now I run "hg postreview" on my cloned local repo. I select "MyRepo" when postreview asks me to choose a repo.
I get a "File not found (207)" error after the command completion. Howver, my review request is uploaded to Review Board server but the diff file is not. Can you tell me what am I doing wrong or is there a patch or command I am not aware of?
I am a novice in DVCS and mercurial, so any help on this matter is really appreciated.
It sounds like you already pushed changes or did more than one commit to the clone (that diffs now more than one commit). Try this and refer to the changeset you created the clone from:
hg postreview -l -o --parent={changeset}
If you wan’t to submit further editings refer to the rewiewid and changeset your first postreview command submitted:
hg postreview -e {reviewid} -o --parent={changeset}