~ubuntu-branches/debian/sid/tortoisehg/sid

« back to all changes in this revision

Viewing changes to tortoisehg/util/hglib.py

  • Committer: Bazaar Package Importer
  • Author(s): Ludovico Cavedon
  • Date: 2011-02-15 14:45:53 UTC
  • mfrom: (1.2.1 upstream) (13.1.4 experimental)
  • Revision ID: james.westby@ubuntu.com-20110215144553-ly46mhc1v0wb9v83
Tags: 1.1.9.1-1
* Upload to unstable.
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
import time
12
12
import inspect
13
13
 
 
14
from mercurial import demandimport
 
15
demandimport.disable()
 
16
try:
 
17
    # hg >= 1.7
 
18
    from mercurial.cmdutil import updatedir
 
19
except ImportError:
 
20
    # hg <= 1.6
 
21
    from mercurial.patch import updatedir
 
22
demandimport.enable()
 
23
 
14
24
from mercurial import ui, util, extensions, match, bundlerepo, url, cmdutil
15
25
from mercurial import dispatch, encoding, templatefilters, filemerge
16
26
 
199
209
    if 'mq' in repo.__dict__: #do not create if it does not exist
200
210
        repo.mq.invalidate()
201
211
 
 
212
def allextensions():
 
213
    """Return the {name: shortdesc} dict of known extensions
 
214
 
 
215
    shortdesc is in local encoding.
 
216
    """
 
217
    enabledexts = extensions.enabled()[0]
 
218
    disabledexts = extensions.disabled()[0]
 
219
    exts = (disabledexts or {}).copy()
 
220
    exts.update(enabledexts)
 
221
    return exts
 
222
 
 
223
def validateextensions(enabledexts):
 
224
    """Report extensions which should be disabled
 
225
 
 
226
    Returns the dict {name: message} of extensions expected to be disabled.
 
227
    message is 'utf-8'-encoded string.
 
228
    """
 
229
    from tortoisehg.util.i18n import _  # avoid cyclic dependency
 
230
    exts = {}
 
231
    if os.name != 'posix':
 
232
        exts['inotify'] = _('inotify is not supported on this platform')
 
233
    if 'win32text' in enabledexts:
 
234
        exts['eol'] = _('eol is incompatible with win32text')
 
235
    if 'eol' in enabledexts:
 
236
        exts['win32text'] = _('win32text is incompatible with eol')
 
237
    return exts
 
238
 
202
239
def loadextension(ui, name):
203
240
    # Between Mercurial revisions 1.2 and 1.3, extensions.load() stopped
204
241
    # calling uisetup() after loading an extension.  This could do
272
309
    'returns the configured merge tools and the internal ones'
273
310
    if values == None:
274
311
        values = []
 
312
    seen = values[:]
275
313
    for key, value in ui.configitems('merge-tools'):
276
314
        t = key.split('.')[0]
277
 
        if t not in values:
 
315
        if t not in seen:
 
316
            seen.append(t)
278
317
            # Ensure the tool is installed
279
318
            if filemerge._findtool(ui, t):
280
319
                values.append(t)