Skip to content
Snippets Groups Projects
Commit 42ae1b1f authored by Martin von Zweigbergk's avatar Martin von Zweigbergk
Browse files

largefiles: start by finding files of interest

Instead of iterating over 'g' action, first find the set of all files
that are largefiles in p1. Then iterate over these files. This
prepares for considering actions other than 'g'.
parent 38e55e55
No related branches found
No related tags found
No related merge requests found
......@@ -426,7 +426,8 @@
return actions, diverge, renamedelete
# Convert to dictionary with filename as key and action as value.
lfiles = set()
actionbyfile = {}
for m, l in actions.iteritems():
for f, args, msg in l:
actionbyfile[f] = m, args, msg
......@@ -429,7 +430,10 @@
actionbyfile = {}
for m, l in actions.iteritems():
for f, args, msg in l:
actionbyfile[f] = m, args, msg
removes = set(a[0] for a in actions['r'])
splitstandin = f and lfutil.splitstandin(f)
if splitstandin in p1:
lfiles.add(splitstandin)
elif lfutil.standin(f) in p1:
lfiles.add(f)
......@@ -435,8 +439,8 @@
for action in actions['g']:
f, args, msg = action
splitstandin = f and lfutil.splitstandin(f)
if (splitstandin is not None and
splitstandin in p1 and splitstandin not in removes):
for lfile in lfiles:
standin = lfutil.standin(lfile)
lm = actionbyfile.get(lfile, (None, None, None))[0]
sm = actionbyfile.get(standin, (None, None, None))[0]
if sm == 'g' and lm != 'r':
# Case 1: normal file in the working copy, largefile in
# the second parent
......@@ -441,7 +445,5 @@
# Case 1: normal file in the working copy, largefile in
# the second parent
lfile = splitstandin
standin = f
usermsg = _('remote turned local normal file %s into a largefile\n'
'use (l)argefile or keep (n)ormal file?'
'$$ &Largefile $$ &Normal file') % lfile
......@@ -454,6 +456,6 @@
else:
actionbyfile[standin] = ('r', None,
'replaced by non-standin')
elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes:
elif lm == 'g' and sm != 'r':
# Case 2: largefile in the working copy, normal file in
# the second parent
......@@ -458,7 +460,5 @@
# Case 2: largefile in the working copy, normal file in
# the second parent
standin = lfutil.standin(f)
lfile = f
usermsg = _('remote turned local largefile %s into a normal file\n'
'keep (l)argefile or use (n)ormal file?'
'$$ &Largefile $$ &Normal file') % lfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment