forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1393242 - Vendor python-hglib 2.4; r=mshal
python-hglib is a Python client for Mercurial's command server. It facilitates querying Mercurial efficiently (using a single process) and without having to parse output in the common case. Let's vendor it so we can make use of it for more advanced Mercurial scenarios. Content vendored from changeset 820d7c1e470a without modifications (other than deleting unwanted files). As part of vendoring, we add the package to the virtualenv and make it available to mach. MozReview-Commit-ID: F4KLbW1lAvk --HG-- extra : rebase_source : ad81f3aa4843312d300d80ce563d40736af2c16a
- Loading branch information
Showing
10 changed files
with
2,330 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2011 Matt Mackall and other contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import subprocess | ||
from hglib import client, util, error | ||
|
||
HGPATH = 'hg' | ||
|
||
def open(path=None, encoding=None, configs=None): | ||
'''starts a cmdserver for the given path (or for a repository found | ||
in the cwd). HGENCODING is set to the given encoding. configs is a | ||
list of key, value, similar to those passed to hg --config. | ||
''' | ||
return client.hgclient(path, encoding, configs) | ||
|
||
def init(dest=None, ssh=None, remotecmd=None, insecure=False, | ||
encoding=None, configs=None): | ||
args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd, | ||
insecure=insecure) | ||
|
||
args.insert(0, HGPATH) | ||
proc = util.popen(args) | ||
out, err = proc.communicate() | ||
if proc.returncode: | ||
raise error.CommandError(args, proc.returncode, out, err) | ||
|
||
return client.hgclient(dest, encoding, configs, connect=False) | ||
|
||
def clone(source=None, dest=None, noupdate=False, updaterev=None, rev=None, | ||
branch=None, pull=False, uncompressed=False, ssh=None, remotecmd=None, | ||
insecure=False, encoding=None, configs=None): | ||
args = util.cmdbuilder('clone', source, dest, noupdate=noupdate, | ||
updaterev=updaterev, rev=rev, branch=branch, | ||
pull=pull, uncompressed=uncompressed, | ||
e=ssh, remotecmd=remotecmd, insecure=insecure) | ||
|
||
args.insert(0, HGPATH) | ||
proc = util.popen(args) | ||
out, err = proc.communicate() | ||
if proc.returncode: | ||
raise error.CommandError(args, proc.returncode, out, err) | ||
|
||
return client.hgclient(dest, encoding, configs, connect=False) |
Oops, something went wrong.