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.
importosfrommercurialimporthg,cmdutil,util,uiimportthgutilimportsystry:frommercurial.errorimportRepoErrorexceptImportError:frommercurial.repoimportRepoErrortry:fromwin32apiimportGetTickCountCACHE_TIMEOUT=5000exceptImportError:fromtimeimporttimeasGetTickCountCACHE_TIMEOUT=5.0UNCHANGED="unchanged"ADDED="added"MODIFIED="modified"UNKNOWN="unknown"IGNORED="ignored"NOT_IN_REPO="n/a"# file status cacheoverlay_cache={}cache_tick_count=0cache_root=Nonecache_pdir=Nonedefadd_dirs(list):dirs=set()forfinlist:pdir=os.path.dirname(f)ifpdirindirs:continuewhilepdir:dirs.add(pdir)pdir=os.path.dirname(pdir)list.extend(dirs)defget_state(upath,repo=None):""" Get the state of a given path in source control. """globaloverlay_cache,cache_tick_countglobalcache_root,cache_pdir#print "called: _get_state(%s)" % pathtc=GetTickCount()try:# handle some Asian charsetspath=upath.encode('mbcs')except:path=upath# check if path is cachedpdir=os.path.dirname(path)ifcache_pdir==pdirandoverlay_cache:iftc-cache_tick_count<CACHE_TIMEOUT:status=overlay_cache.get(path,NOT_IN_REPO)print"%s: %s (cached)"%(path,status)returnstatuselse:print"Timed out!!"overlay_cache.clear()# path is a driveifpath.endswith(":\\"):overlay_cache[path]=UNKNOWNreturnNOT_IN_REPO# open repoifcache_pdir==pdir:root=cache_rootelse:print"find new root"cache_pdir=pdircache_root=root=thgutil.find_root(pdir)print"_get_state: root = ",rootifrootisNone:print"_get_state: not in repo"overlay_cache={None:None}cache_tick_count=GetTickCount()returnNOT_IN_REPOhgdir=os.path.join(root,'.hg','')ifpdir==hgdir[:-1]orpdir.startswith(hgdir):ifnotoverlay_cache:cache_tick_count=GetTickCount()overlay_cache[pdir]=NOT_IN_REPO return NOT_IN_REPO
try:
tc1 = GetTickCount()
- if not repo or repo.root == cache_root:
+ if not repo or (repo.root != root and repo.root != os.path.realpath(root)):
repo = hg.repository(ui.ui(), path=root)
- print "hg.repository() took %g ticks" % (GetTickCount() - tc1)
+ print "hg.repository() took %g ticks" % (GetTickCount() - tc1)
# check if to display overlay icons in this repo
overlayopt = repo.ui.config('tortoisehg', 'overlayicons', ' ').lower()
print "%s: repo overlayicons = " % path, overlayopt
ifoverlayopt=='localdisk':overlayopt=bool(thgutil.netdrive_status(path))ifnotoverlayoptoroverlayoptin'false off no'.split():print"%s: overlayicons disabled"%pathoverlay_cache={None:None}cache_tick_count=GetTickCount()returnNOT_IN_REPOexceptRepoError:# We aren't in a working treeprint"%s: not in repo"%pdirifnotoverlay_cache:cache_tick_count=GetTickCount()overlay_cache[pdir]=IGNOREDreturnIGNOREDexceptStandardError,e:print"error while handling %s:"%pdirprinteifnotoverlay_cache:cache_tick_count=GetTickCount()overlay_cache[pdir]=UNKNOWNreturnUNKNOWN# get file statustc1=GetTickCount()try:matcher=cmdutil.match(repo,[pdir])repostate=repo.status(match=matcher,ignored=True,clean=True,unknown=True)# add directory status to listforgrpinrepostate:add_dirs(grp)exceptutil.Abort,inst:print"abort: %s"%instprint"treat as unknown : %s"%pathreturnUNKNOWNprint"status() took %g ticks"%(GetTickCount()-tc1)modified,added,removed,deleted,unknown,ignored,clean=repostate# cached file infotc=GetTickCount()overlay_cache={}forgrp,stin((ignored,IGNORED),(unknown,UNKNOWN),(clean,UNCHANGED),(added,ADDED),(removed,MODIFIED),(deleted,MODIFIED),(modified,MODIFIED)):forfingrp:fpath=os.path.join(root,os.path.normpath(f))overlay_cache[fpath]=ststatus=overlay_cache.get(path,UNKNOWN)print"%s: %s"%(path,status)cache_tick_count=GetTickCount()returnstatus
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.