##// END OF EJS Templates
sparse: clean up updateconfig()...
Gregory Szorc -
r33375:df6dd6d5 default
parent child Browse files
Show More
@@ -592,18 +592,12 b' def updateconfig(repo, pats, opts, inclu'
592
592
593 The new config is written out and a working directory refresh is performed.
593 The new config is written out and a working directory refresh is performed.
594 """
594 """
595 wlock = repo.wlock()
595 with repo.wlock():
596 try:
596 oldmatcher = matcher(repo)
597 oldsparsematch = matcher(repo)
598
597
599 raw = repo.vfs.tryread('sparse')
598 raw = repo.vfs.tryread('sparse')
600 if raw:
599 oldinclude, oldexclude, oldprofiles = parseconfig(repo.ui, raw)
601 oldinclude, oldexclude, oldprofiles = map(
600 oldprofiles = set(oldprofiles)
602 set, parseconfig(repo.ui, raw))
603 else:
604 oldinclude = set()
605 oldexclude = set()
606 oldprofiles = set()
607
601
608 try:
602 try:
609 if reset:
603 if reset:
@@ -637,7 +631,7 b' def updateconfig(repo, pats, opts, inclu'
637
631
638 fcounts = map(
632 fcounts = map(
639 len,
633 len,
640 refreshwdir(repo, oldstatus, oldsparsematch, force=force))
634 refreshwdir(repo, oldstatus, oldmatcher, force=force))
641
635
642 profilecount = (len(newprofiles - oldprofiles) -
636 profilecount = (len(newprofiles - oldprofiles) -
643 len(oldprofiles - newprofiles))
637 len(oldprofiles - newprofiles))
@@ -650,8 +644,6 b' def updateconfig(repo, pats, opts, inclu'
650 except Exception:
644 except Exception:
651 writeconfig(repo, oldinclude, oldexclude, oldprofiles)
645 writeconfig(repo, oldinclude, oldexclude, oldprofiles)
652 raise
646 raise
653 finally:
654 wlock.release()
655
647
656 def printchanges(ui, opts, profilecount=0, includecount=0, excludecount=0,
648 def printchanges(ui, opts, profilecount=0, includecount=0, excludecount=0,
657 added=0, dropped=0, conflicting=0):
649 added=0, dropped=0, conflicting=0):
General Comments 0
You need to be logged in to leave comments. Login now