Patchwork [4,of,7] largefiles: don't unnecessarily sort merge action lists

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 10, 2014, 9:09 p.m.
Message ID <d1e6b639fb6c687ac461.1418245742@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7044/
State Accepted
Commit e61de5556b73b927dde04c823f8ed9f25c743b78
Headers show

Comments

Martin von Zweigbergk - Dec. 10, 2014, 9:09 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1418080842 28800
#      Mon Dec 08 15:20:42 2014 -0800
# Node ID d1e6b639fb6c687ac4614946de96eb3eb4c7c13f
# Parent  0dd375bce97ee24ed24d13713beadc52a04c8116
largefiles: don't unnecessarily sort merge action lists

The action lists returned from calculateupdates() (in merge.py) are
not required to be sorted. In fact, since they result from iteration
over the unordered manifest, they are unlikely to be sorted. Moreover,
some of the lists are appended to after they are returned from
manifestmerge(). The lists are instead sorted in
applyupdates(). Therefore, let's not sort the lists generated in
largefiles' overridecalculateupdates().

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -476,10 +476,8 @@ 
         else:
             newglist.append(action)
 
-    newglist.sort()
     actions['g'] = newglist
     if lfmr:
-        lfmr.sort()
         actions['lfmr'] = lfmr
 
     return actions, diverge, renamedelete