Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
# hglib.py - Mercurial API wrappers for TortoiseHg## Copyright 2007 Steve Borho <steve@borho.org>## This software may be used and distributed according to the terms of the# GNU General Public License version 2, incorporated herein by reference.importosimportsysimporttracebackimportshlibimporttimefrommercurialimporthg,ui,util,extensions,commands,hookfromi18nimport_importpathsfrommercurial.errorimportRepoError,ParseError,LookupErrorfrommercurial.errorimportUnknownCommand,AmbiguousCommandfrommercurialimportdispatch,encoding,util_encoding=encoding.encoding_encodingmode=encoding.encodingmode_fallbackencoding=encoding.fallbackencodingtry:# post 1.1.2frommercurialimportutilhgversion=util.version()exceptAttributeError:# <= 1.1.2frommercurialimportversionhgversion=version.get_version()deftoutf(s):""" Convert a string to UTF-8 encoding Based on mercurial.util.tolocal() """forein('utf-8',_encoding):try:returns.decode(e,'strict').encode('utf-8')exceptUnicodeDecodeError:passreturns.decode(_fallbackencoding,'replace').encode('utf-8')deffromutf(s):""" Convert UTF-8 encoded string to local. It's primarily used on strings converted to UTF-8 by toutf(). """try:returns.decode('utf-8').encode(_encoding)exceptUnicodeDecodeError:passexceptUnicodeEncodeError:passreturns.decode('utf-8').encode(_fallbackencoding)_tabwidth=Nonedefgettabwidth(ui):global_tabwidthif_tabwidthisnotNone:return_tabwidthtabwidth=ui.config('tortoisehg','tabwidth')try:tabwidth=int(tabwidth)iftabwidth<1ortabwidth>16:tabwidth=0except(ValueError,TypeError):tabwidth=0_tabwidth=tabwidthreturntabwidth_maxdiff=Nonedefgetmaxdiffsize(ui):global_maxdiffif_maxdiffisnotNone:return_maxdiffmaxdiff=ui.config('tortoisehg','maxdiff')try:maxdiff=int(maxdiff)ifmaxdiff<1:maxdiff=sys.maxintexcept(ValueError,TypeError):maxdiff=1024# 1MB by default_maxdiff=maxdiff*1024return_maxdiffdefdiffexpand(line):'Expand tabs in a line of diff/patch text'if_tabwidthisNone:gettabwidth(ui.ui())ifnot_tabwidthorlen(line)<2:returnlinereturnline[0]+line[1:].expandtabs(_tabwidth)defuiwrite(u,args):''' write args if there are buffers returns True if the caller shall handle writing '''ifu._buffers:ui.ui.write(u,*args)returnFalsereturnTruedefinvalidaterepo(repo):repo.invalidate()repo.dirstate.invalidate()if'mq'inrepo.__dict__:#do not create if it does not existrepo.mq.invalidate()def canonpaths(list):
'Get canonical paths (relative to root) for list of files'
+ # This is a horrible hack. Please remove this when HG acquires a+ # decent case-folding solution. canonpats = []
cwd = os.getcwd()
root = paths.find_root(cwd)
forfinlist:try:canonpats.append(util.canonpath(root,cwd,f))exceptutil.Abort:# Attempt to resolve case folding conflicts.fu=f.upper()cwdu=cwd.upper()iffu.startswith(cwdu):canonpats.append(util.canonpath(root,cwd,f[len(cwd+os.sep):]))else:# May already be canonicalcanonpats.append(f)returncanonpatsdefhgcmd_toq(path,q,*args):''' Run an hg command in a background thread, pipe all output to a Queue object. Assumes command is completely noninteractive. '''classQui(ui.ui):def__init__(self,src=None):super(Qui,self).__init__(src)self.setconfig('ui','interactive','off')defwrite(self,*args):ifuiwrite(self,args):forainargs:q.put(str(a))u=Qui()fork,vinu.configitems('defaults'):u.setconfig('defaults',k,'')returndispatch._dispatch(u,list(args))defdisplaytime(date):returnutil.datestr(date,'%Y-%m-%d %H:%M:%S %1%2')defutctime(date):returntime.strftime("%Y-%m-%d %H:%M:%S",time.gmtime(date[0]))
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.