comparison mercurial/localrepo.py @ 42062:8de1b5a009ee

localrepo: rename crev in _filecommit() to cnode, since it's a node I know we often use "rev" generically, but here's it always a node, so it helps to be specific. Differential Revision: https://phab.mercurial-scm.org/D6181
author Martin von Zweigbergk <martinvonz@google.com>
date Mon, 25 Dec 2017 05:55:50 -0800
parents 4ee906aa7b60
children fcd7a91dec23
comparison
equal deleted inserted replaced
42061:f3365065ef1d 42062:8de1b5a009ee
2340 # 0 --- 1 --- 3 rev4 reverts the content change from rev2 2340 # 0 --- 1 --- 3 rev4 reverts the content change from rev2
2341 # \ / merging rev3 and rev4 should use bar@rev2 2341 # \ / merging rev3 and rev4 should use bar@rev2
2342 # \- 2 --- 4 as the merge base 2342 # \- 2 --- 4 as the merge base
2343 # 2343 #
2344 2344
2345 crev = manifest1.get(cfname) 2345 cnode = manifest1.get(cfname)
2346 newfparent = fparent2 2346 newfparent = fparent2
2347 2347
2348 if manifest2: # branch merge 2348 if manifest2: # branch merge
2349 if fparent2 == nullid or crev is None: # copied on remote side 2349 if fparent2 == nullid or cnode is None: # copied on remote side
2350 if cfname in manifest2: 2350 if cfname in manifest2:
2351 crev = manifest2[cfname] 2351 cnode = manifest2[cfname]
2352 newfparent = fparent1 2352 newfparent = fparent1
2353 2353
2354 # Here, we used to search backwards through history to try to find 2354 # Here, we used to search backwards through history to try to find
2355 # where the file copy came from if the source of a copy was not in 2355 # where the file copy came from if the source of a copy was not in
2356 # the parent directory. However, this doesn't actually make sense to 2356 # the parent directory. However, this doesn't actually make sense to
2358 # mean?) and it causes bugs (eg, issue4476). Instead, we will warn 2358 # mean?) and it causes bugs (eg, issue4476). Instead, we will warn
2359 # the user that copy information was dropped, so if they didn't 2359 # the user that copy information was dropped, so if they didn't
2360 # expect this outcome it can be fixed, but this is the correct 2360 # expect this outcome it can be fixed, but this is the correct
2361 # behavior in this circumstance. 2361 # behavior in this circumstance.
2362 2362
2363 if crev: 2363 if cnode:
2364 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(crev))) 2364 self.ui.debug(" %s: copy %s:%s\n" % (fname, cfname, hex(cnode)))
2365 meta["copy"] = cfname 2365 meta["copy"] = cfname
2366 meta["copyrev"] = hex(crev) 2366 meta["copyrev"] = hex(cnode)
2367 fparent1, fparent2 = nullid, newfparent 2367 fparent1, fparent2 = nullid, newfparent
2368 else: 2368 else:
2369 self.ui.warn(_("warning: can't find ancestor for '%s' " 2369 self.ui.warn(_("warning: can't find ancestor for '%s' "
2370 "copied from '%s'!\n") % (fname, cfname)) 2370 "copied from '%s'!\n") % (fname, cfname))
2371 2371