hgext/largefiles/lfcommands.py
changeset 27820 d2e9cc9edc08
parent 27774 8ceaaf63ca80
child 28463 19b4a2087dfc
equal deleted inserted replaced
27819:e401dfd79ec7 27820:d2e9cc9edc08
   424 
   424 
   425     If ``printmessage`` is other than ``None``, it means "print (or
   425     If ``printmessage`` is other than ``None``, it means "print (or
   426     ignore, for false) message forcibly".
   426     ignore, for false) message forcibly".
   427     '''
   427     '''
   428     statuswriter = lfutil.getstatuswriter(ui, repo, printmessage)
   428     statuswriter = lfutil.getstatuswriter(ui, repo, printmessage)
   429     wlock = repo.wlock()
   429     with repo.wlock():
   430     try:
       
   431         lfdirstate = lfutil.openlfdirstate(ui, repo)
   430         lfdirstate = lfutil.openlfdirstate(ui, repo)
   432         lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
   431         lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
   433 
   432 
   434         if filelist is not None:
   433         if filelist is not None:
   435             filelist = set(filelist)
   434             filelist = set(filelist)
   502 
   501 
   503         lfdirstate.write()
   502         lfdirstate.write()
   504         if lfiles:
   503         if lfiles:
   505             statuswriter(_('%d largefiles updated, %d removed\n') % (updated,
   504             statuswriter(_('%d largefiles updated, %d removed\n') % (updated,
   506                 removed))
   505                 removed))
   507     finally:
       
   508         wlock.release()
       
   509 
   506 
   510 @command('lfpull',
   507 @command('lfpull',
   511     [('r', 'rev', [], _('pull largefiles for these revisions'))
   508     [('r', 'rev', [], _('pull largefiles for these revisions'))
   512     ] + commands.remoteopts,
   509     ] + commands.remoteopts,
   513     _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]'))
   510     _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]'))