hgext/largefiles/overrides.py
branchstable
changeset 19954 427ce5633c1c
parent 19953 593207462618
child 19967 e92c6524a76d
equal deleted inserted replaced
19953:593207462618 19954:427ce5633c1c
   372                      acceptremote)
   372                      acceptremote)
   373 
   373 
   374     if overwrite:
   374     if overwrite:
   375         return actions
   375         return actions
   376 
   376 
       
   377     removes = set(a[0] for a in actions if a[1] == 'r')
   377     processed = []
   378     processed = []
   378 
   379 
   379     for action in actions:
   380     for action in actions:
   380         f, m, args, msg = action
   381         f, m, args, msg = action
   381 
   382 
   382         splitstandin = lfutil.splitstandin(f)
   383         splitstandin = lfutil.splitstandin(f)
   383         if (m == "g" and splitstandin is not None and
   384         if (m == "g" and splitstandin is not None and
   384             splitstandin in p1):
   385             splitstandin in p1 and splitstandin not in removes):
   385             # Case 1: normal file in the working copy, largefile in
   386             # Case 1: normal file in the working copy, largefile in
   386             # the second parent
   387             # the second parent
   387             lfile = splitstandin
   388             lfile = splitstandin
   388             standin = f
   389             standin = f
   389             msg = _('%s has been turned into a largefile\n'
   390             msg = _('%s has been turned into a largefile\n'
   392             if repo.ui.promptchoice(msg, 0) == 0:
   393             if repo.ui.promptchoice(msg, 0) == 0:
   393                 processed.append((lfile, "r", None, msg))
   394                 processed.append((lfile, "r", None, msg))
   394                 processed.append((standin, "g", (p2.flags(standin),), msg))
   395                 processed.append((standin, "g", (p2.flags(standin),), msg))
   395             else:
   396             else:
   396                 processed.append((standin, "r", None, msg))
   397                 processed.append((standin, "r", None, msg))
   397         elif m == "g" and lfutil.standin(f) in p1:
   398         elif (m == "g" and
       
   399             lfutil.standin(f) in p1 and lfutil.standin(f) not in removes):
   398             # Case 2: largefile in the working copy, normal file in
   400             # Case 2: largefile in the working copy, normal file in
   399             # the second parent
   401             # the second parent
   400             standin = lfutil.standin(f)
   402             standin = lfutil.standin(f)
   401             lfile = f
   403             lfile = f
   402             msg = _('%s has been turned into a normal file\n'
   404             msg = _('%s has been turned into a normal file\n'