mercurial/hg.py
changeset 408 3695fbd2c33b
parent 407 0e0d0670b2bc
child 412 40cfa2d0c088
equal deleted inserted replaced
407:0e0d0670b2bc 408:3695fbd2c33b
  1009         ma = self.manifest.read(man)
  1009         ma = self.manifest.read(man)
  1010         mfa = self.manifest.readflags(m2n)
  1010         mfa = self.manifest.readflags(m2n)
  1011 
  1011 
  1012         (c, a, d, u) = self.diffdir(self.root)
  1012         (c, a, d, u) = self.diffdir(self.root)
  1013 
  1013 
       
  1014         # is this a jump, or a merge?  i.e. is there a linear path
       
  1015         # from p1 to p2?
       
  1016         linear_path = (pa == p1 or pa == p2)
       
  1017 
  1014         # resolve the manifest to determine which files
  1018         # resolve the manifest to determine which files
  1015         # we care about merging
  1019         # we care about merging
  1016         self.ui.note("resolving manifests\n")
  1020         self.ui.note("resolving manifests\n")
  1017         self.ui.debug(" ancestor %s local %s remote %s\n" %
  1021         self.ui.debug(" ancestor %s local %s remote %s\n" %
  1018                       (short(man), short(m1n), short(m2n)))
  1022                       (short(man), short(m1n), short(m2n)))
  1028         for f in a + c + u:
  1032         for f in a + c + u:
  1029             mw[f] = ""
  1033             mw[f] = ""
  1030             mfw[f] = is_exec(self.wjoin(f))
  1034             mfw[f] = is_exec(self.wjoin(f))
  1031         for f in d:
  1035         for f in d:
  1032             if f in mw: del mw[f]
  1036             if f in mw: del mw[f]
       
  1037 
       
  1038             # If we're jumping between revisions (as opposed to merging),
       
  1039             # and if neither the working directory nor the target rev has
       
  1040             # the file, then we need to remove it from the dirstate, to
       
  1041             # prevent the dirstate from listing the file when it is no
       
  1042             # longer in the manifest.
       
  1043             if linear_path and f not in m2:
       
  1044                 self.dirstate.forget((f,))
  1033 
  1045 
  1034         for f, n in mw.iteritems():
  1046         for f, n in mw.iteritems():
  1035             if f in m2:
  1047             if f in m2:
  1036                 s = 0
  1048                 s = 0
  1037 
  1049 
  1115         if force:
  1127         if force:
  1116             for f in merge:
  1128             for f in merge:
  1117                 get[f] = merge[f][1]
  1129                 get[f] = merge[f][1]
  1118             merge = {}
  1130             merge = {}
  1119 
  1131 
  1120         if pa == p1 or pa == p2:
  1132         if linear_path:
  1121             # we don't need to do any magic, just jump to the new rev
  1133             # we don't need to do any magic, just jump to the new rev
  1122             mode = 'n'
  1134             mode = 'n'
  1123             p1, p2 = p2, nullid
  1135             p1, p2 = p2, nullid
  1124         else:
  1136         else:
  1125             if not allow:
  1137             if not allow: