Mercurial > hg
comparison mercurial/changegroup.py @ 39005:d56a6b78de3b
changegroup: invert conditional and dedent
I don't like seeing code that visually resembles the pyramid of
doom.
Differential Revision: https://phab.mercurial-scm.org/D4197
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 07 Aug 2018 15:13:25 -0700 |
parents | e11d07cc125c |
children | 5959ef78d834 |
comparison
equal
deleted
inserted
replaced
39004:e11d07cc125c | 39005:d56a6b78de3b |
---|---|
1046 size = 0 | 1046 size = 0 |
1047 while tmfnodes: | 1047 while tmfnodes: |
1048 dir, nodes = tmfnodes.popitem() | 1048 dir, nodes = tmfnodes.popitem() |
1049 store = dirlog(dir) | 1049 store = dirlog(dir) |
1050 prunednodes = self._prune(store, nodes, commonrevs) | 1050 prunednodes = self._prune(store, nodes, commonrevs) |
1051 if not dir or prunednodes: | 1051 |
1052 lookupfn = makelookupmflinknode(dir, nodes) | 1052 if dir and not prunednodes: |
1053 | 1053 continue |
1054 if self._ellipses: | 1054 |
1055 revs = _sortnodesellipsis(store, prunednodes, cl, | 1055 lookupfn = makelookupmflinknode(dir, nodes) |
1056 lookupfn) | 1056 |
1057 else: | 1057 if self._ellipses: |
1058 revs = _sortnodesnormal(store, prunednodes, | 1058 revs = _sortnodesellipsis(store, prunednodes, cl, |
1059 self._reorder) | 1059 lookupfn) |
1060 | 1060 else: |
1061 for x in self._packmanifests(dir, store, revs, lookupfn, | 1061 revs = _sortnodesnormal(store, prunednodes, |
1062 clrevtolocalrev): | 1062 self._reorder) |
1063 size += len(x) | 1063 |
1064 yield x | 1064 for x in self._packmanifests(dir, store, revs, lookupfn, |
1065 clrevtolocalrev): | |
1066 size += len(x) | |
1067 yield x | |
1068 | |
1065 self._verbosenote(_('%8.i (manifests)\n') % size) | 1069 self._verbosenote(_('%8.i (manifests)\n') % size) |
1066 yield self._manifestsend | 1070 yield self._manifestsend |
1067 | 1071 |
1068 # The 'source' parameter is useful for extensions | 1072 # The 'source' parameter is useful for extensions |
1069 def generatefiles(self, changedfiles, commonrevs, source, | 1073 def generatefiles(self, changedfiles, commonrevs, source, |