Mercurial > public > mercurial-scm > hg
comparison mercurial/hg.py @ 690:f762860f82c6
Minor merge fixups
return a proper errorlevel on abort
let force jump across branches
catch exception on unlink
manifest hash: 6787814cd75e9f9623c56dc36f865afd54f56bfa
author | mpm@selenic.com |
---|---|
date | Wed, 13 Jul 2005 01:46:50 -0800 |
parents | d7d68d27ebe5 |
children | 61c6b4178b9e |
comparison
equal
deleted
inserted
replaced
689:4315db147f00 | 690:f762860f82c6 |
---|---|
1251 def update(self, node, allow=False, force=False, choose=None, | 1251 def update(self, node, allow=False, force=False, choose=None, |
1252 moddirstate=True): | 1252 moddirstate=True): |
1253 pl = self.dirstate.parents() | 1253 pl = self.dirstate.parents() |
1254 if not force and pl[1] != nullid: | 1254 if not force and pl[1] != nullid: |
1255 self.ui.warn("aborting: outstanding uncommitted merges\n") | 1255 self.ui.warn("aborting: outstanding uncommitted merges\n") |
1256 return | 1256 return 1 |
1257 | 1257 |
1258 p1, p2 = pl[0], node | 1258 p1, p2 = pl[0], node |
1259 pa = self.changelog.ancestor(p1, p2) | 1259 pa = self.changelog.ancestor(p1, p2) |
1260 m1n = self.changelog.read(p1)[0] | 1260 m1n = self.changelog.read(p1)[0] |
1261 m2n = self.changelog.read(p2)[0] | 1261 m2n = self.changelog.read(p2)[0] |
1405 if force: | 1405 if force: |
1406 for f in merge: | 1406 for f in merge: |
1407 get[f] = merge[f][1] | 1407 get[f] = merge[f][1] |
1408 merge = {} | 1408 merge = {} |
1409 | 1409 |
1410 if linear_path: | 1410 if linear_path or force: |
1411 # we don't need to do any magic, just jump to the new rev | 1411 # we don't need to do any magic, just jump to the new rev |
1412 mode = 'n' | 1412 mode = 'n' |
1413 p1, p2 = p2, nullid | 1413 p1, p2 = p2, nullid |
1414 else: | 1414 else: |
1415 if not allow: | 1415 if not allow: |
1462 self.dirstate.update([f], 'm') | 1462 self.dirstate.update([f], 'm') |
1463 | 1463 |
1464 remove.sort() | 1464 remove.sort() |
1465 for f in remove: | 1465 for f in remove: |
1466 self.ui.note("removing %s\n" % f) | 1466 self.ui.note("removing %s\n" % f) |
1467 os.unlink(f) | 1467 try: |
1468 os.unlink(f) | |
1469 except OSError, inst: | |
1470 self.ui.warn("update failed to remove %s: %s!\n" % (f, inst)) | |
1468 # try removing directories that might now be empty | 1471 # try removing directories that might now be empty |
1469 try: os.removedirs(os.path.dirname(f)) | 1472 try: os.removedirs(os.path.dirname(f)) |
1470 except: pass | 1473 except: pass |
1471 if moddirstate: | 1474 if moddirstate: |
1472 if mode == 'n': | 1475 if mode == 'n': |