D5278: narrow: detect if narrowspec was changed in a different share

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sat Dec 22 21:23:10 EST 2018


yuja added a comment.


  Queued, thanks.
  
  > +def copytoworkingcopy(repo, tr):
  >  +    if tr:
  >  +        def write(file):
  >  +            spec = repo.svfs.read(FILENAME)
  >  +            file.write(spec)
  >  +            file.close()
  >  +        tr.addfilegenerator('narrowspec', (DIRSTATE_FILENAME,), write,
  >  +                            location='plain')
  >  +    else:
  >  +        spec = repo.svfs.read(FILENAME)
  >  +        repo.vfs.write(DIRSTATE_FILENAME, spec)
  
  Maybe `write(..., atomictemp=True)` is a safer option.
  
  > +def _writeaddedfiles(repo, pctx, files):
  >  +    actions = merge.emptyactions()
  >  +    addgaction = actions['g'].append
  
  Nit: `merge.ACTION_GET`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5278

To: martinvonz, durin42, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list