Questions tagged [mercurial-api]
14 questions
21
votes
1 answer
How can I list a series of revisions using 'hg log'?
I'm attempting to use the hg log command to show a series of revisions, x through y.
When I do this:
hg log -r 1+5
I get this:
changeset: 1:7320d2a9baa5
user: Tim Post
date: Fri Sep 30 20:38:29 2011…

Tim Post
- 33,371
- 15
- 110
- 174
3
votes
2 answers
How to test the date of a changeset in Mercurial API
I want to use the Mercurial Python API on only changesets that fall within a certain range, and from reading the docs, I haven't been able to work out how to do it.
My code looks like this:
from mercurial import ui, hg
import datetime
repo =…

Clare Macrae
- 3,670
- 2
- 31
- 45
2
votes
1 answer
Hglib: How to connect to remote repo using over ssh?
Using "raw" mercurial API I can write just something like:
peer = hg.peer(ui.ui(), {}, 'ssh://hg@bitbucket.org/some/project')
After the connection is established, I can work with remote repo.
I'm failing to understand what should work with a remote…

shabunc
- 23,119
- 19
- 77
- 102
2
votes
1 answer
Mercurial API: reading config over https
In the Mercurial API, is there any way to read the configuration values associated with a repository that you're accessing over HTTPS? The repository's ui object doesn't seem to hold them.

Shoaib
- 561
- 3
- 11
2
votes
1 answer
Mercurial API: How can I get the coming content of the file which was pulled but has not been updated yet?
I'm a complete noob at Mercurial API and Python, but I'm trying to write a useful extension for myself and my colleagues now.
Let's assume I have a repository which contains some code and an auxiliary file .hgdata. The code and .hgdata are both…

Igor Soloydenko
- 11,067
- 11
- 47
- 90
1
vote
1 answer
How should one manage hook specific files in the '.hg/' state directory?
I'm writing a series of changegroup and commit hooks using the native Python implementation of the Mercurial API. Part of this requires me to save certain bits of information that are specific to my hooks, such as the last revision ID that my hooks…

Tim Post
- 33,371
- 15
- 110
- 174
1
vote
1 answer
Mercurial hooks: How can I detect second head in a particular push?
I'm using server-side (remote) hooks to prevent specific kind of pushes.
Among other thing, I want to ban pushes that are creating new heads in mercurial repository even if they were pushed with --force.
I can think only of one way to achieve…

shabunc
- 23,119
- 19
- 77
- 102
1
vote
1 answer
mercurial API: how do I get the 40 digit revision hash from incoming command?
I am using the python mercurial API in my project.
from mercurial import ui, hg, commands
from mercurial.node import hex
user_id = ui.ui()
hg_repo = hg.repository(user_id, '/path/to/repo')
hg_repo.ui.pushbuffer()
some_is_coming =…

LarsVegas
- 6,522
- 10
- 43
- 67
1
vote
1 answer
i need to write a python script to pull the repository details of mercurial for given 2 dates
i have referred a program which prints all the repository details. Now i want to provide 2 dates i.e. from date and to date as parameters and the repository details between these 2 dates needs to be pulled out. How can this be done. I am not sure…

Jayashree Shetty
- 1,695
- 2
- 11
- 8
1
vote
2 answers
Mercurial API: default-push not set from repo's .hg/hgrc
I'm using MercurialApi for pushing to a remote repo.
u = ui.ui()
repo = hg.repository(u, path)
commands.commit(u, repo, message=message)
commands.push(u, repo)
This block gives me an error:
repository default-push not found
But I have the default…

mathjazz
- 11
- 1
1
vote
4 answers
Access the active bookmark name without parsing a command output?
I'd like to automatically add the active bookmark name (if any) to the commit message.
I found this method to do something similar as a pre-commit hook. However it uses the branch name, which is redundant since named branches are part of metadata. I…

Shadok
- 144
- 5
1
vote
1 answer
python mercurial api: get incoming changes
I have a local copy of mercurial repository "proj1". I want get incoming changes using The Mercurial API via python script.
I tried make it like that:
from mercurial import hg, ui, commands, util, scmutil, httpconnection
repopath =…

Alexey Egorov
- 2,221
- 2
- 18
- 21
0
votes
2 answers
Is there a way to get users and groups for mercurial repository from remote
Is there a way to get users and groups for mercurial repository from remote? I am a newbie to mercurial world and not being able to get much details on this.
I wish to get and set the groups and users on a repository from remote (application).
The…

Kangkan
- 15,267
- 10
- 70
- 113
0
votes
1 answer
TortoiseHg - how refresh list of files from api?
I have in repo some files with specific binary format. I want see its contents.
For such binary file I put in repo specific txt file, containing md5 and nice content from binary.
To minimize manual movements I wrote precommit hook in python that see…

Solo.dmitry
- 690
- 8
- 15