sapling/hgext/largefiles
Martin von Zweigbergk a62307f257 largefiles: rewrite merge code using dictionary with entry per file
In overridecalculateupdates(), we currently only deal with conflicts
that result in a 'g' action for either the largefile or a standin. We
will soon want to deal cases with 'cd' and 'dc' actions here. It will
be easier to reason about such cases if we rewrite it using a dict
from filename to action.

A side-effect of this change is that the output can only have one
action per file (which should be a good change). Before this change,
when one of the tests in test-issue3084 received this input (the 'a'
in the input was a result of 'cd' conflict resolved in favor of the
modified file):

  'g': [('.hglf/f', ('',), 'remote created')],
  'a': [('f', None, 'prompt keep')],

and the user chose to keep the local largefile, it produced this
output:


  'g': [('.hglf/f', ('',), 'remote created')],
  'r': [('f', None, 'replaced by standin')],
  'a': [('f', None, 'prompt keep')],

Although 'a' actions are processed after 'r' actions by
recordupdates(), it still worked because 'a' actions have no effect on
merges (only on updates). After this change, the output is:

  'g': [('.hglf/f', ('',), 'remote created')],
  'r': [('f', None, 'replaced by standin')],

Similarly, there are several tests in test-largefiles-update that get
inputs like:

  'a': [('.hglf/large2', None, 'prompt keep')],
  'g': [('large2', ('',), 'remote created')],

and when the user chooses to keep the local largefile, they produce
this output:

  'a': [('.hglf/large2', None, 'prompt keep'),
        ('.hglf/large2', None, 'keep standin')],
  'lfmr': [('large2', None, 'forget non-standin largefile')],

In this case, it was not a merge but an update, so the 'a' action does
have an effect. However, since dirstate.add() is idempotent, it still
has no obserable effect.

After this change, the output is:

  'a': [('.hglf/large2', None, 'keep standin')],
  'lfmr': [('large2', None, 'forget non-standin largefile')],
2014-12-09 22:03:53 -08:00
..
__init__.py largefiles: define norepo in command decorator 2014-05-04 21:11:15 -07:00
basestore.py largefiles: hide passwords in URLs in ui messages 2013-10-17 16:13:15 +08:00
CONTRIBUTORS hgext: add largefiles extension 2011-09-24 17:35:45 +02:00
lfcommands.py largefiles: move "copyalltostore" invocation into "markcommitted" 2014-11-08 00:48:41 +09:00
lfutil.py largefiles: move "copyalltostore" invocation into "markcommitted" 2014-11-08 00:48:41 +09:00
localstore.py largefiles: don't close the fd passed to store._getfile 2013-04-15 23:47:04 +02:00
overrides.py largefiles: rewrite merge code using dictionary with entry per file 2014-12-09 22:03:53 -08:00
proto.py largefiles: import whole modules instead of importing parts of them 2014-04-08 00:48:36 +02:00
remotestore.py largefiles: import whole modules instead of importing parts of them 2014-04-08 00:48:36 +02:00
reposetup.py merge with stable 2014-11-25 17:30:05 -06:00
uisetup.py largefiles: drop the override for 'fetch' 2014-11-30 23:30:31 -05:00
wirestore.py largefiles: stat all largefiles in one batch before downloading 2013-04-15 23:37:43 +02:00