hgext/journal.py
changeset 37120 a8a902d7176e
parent 37084 f0b6fbea00cf
child 37318 9954d0e2ad00
equal deleted inserted replaced
37119:d4a2e0d5d042 37120:a8a902d7176e
    36     registrar,
    36     registrar,
    37     util,
    37     util,
    38 )
    38 )
    39 from mercurial.utils import (
    39 from mercurial.utils import (
    40     dateutil,
    40     dateutil,
       
    41     procutil,
    41     stringutil,
    42     stringutil,
    42 )
    43 )
    43 
    44 
    44 cmdtable = {}
    45 cmdtable = {}
    45 command = registrar.command(cmdtable)
    46 command = registrar.command(cmdtable)
   253     """
   254     """
   254     _currentcommand = ()
   255     _currentcommand = ()
   255     _lockref = None
   256     _lockref = None
   256 
   257 
   257     def __init__(self, repo):
   258     def __init__(self, repo):
   258         self.user = util.getuser()
   259         self.user = procutil.getuser()
   259         self.ui = repo.ui
   260         self.ui = repo.ui
   260         self.vfs = repo.vfs
   261         self.vfs = repo.vfs
   261 
   262 
   262         # is this working copy using a shared storage?
   263         # is this working copy using a shared storage?
   263         self.sharedfeatures = self.sharedvfs = None
   264         self.sharedfeatures = self.sharedvfs = None
   270 
   271 
   271     # track the current command for recording in journal entries
   272     # track the current command for recording in journal entries
   272     @property
   273     @property
   273     def command(self):
   274     def command(self):
   274         commandstr = ' '.join(
   275         commandstr = ' '.join(
   275             map(util.shellquote, journalstorage._currentcommand))
   276             map(procutil.shellquote, journalstorage._currentcommand))
   276         if '\n' in commandstr:
   277         if '\n' in commandstr:
   277             # truncate multi-line commands
   278             # truncate multi-line commands
   278             commandstr = commandstr.partition('\n')[0] + ' ...'
   279             commandstr = commandstr.partition('\n')[0] + ' ...'
   279         return commandstr
   280         return commandstr
   280 
   281