comparison mercurial/localrepo.py @ 1674:dee55c4a4963

abort when using 'update -m' and this is not a merge add more testcases for updating with local changes
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Wed, 01 Feb 2006 08:46:24 +0100
parents daff3ef0de8d
children c21b54f7f7b8
comparison
equal deleted inserted replaced
1667:daff3ef0de8d 1674:dee55c4a4963
1397 ma = self.manifest.read(man) 1397 ma = self.manifest.read(man)
1398 mfa = self.manifest.readflags(man) 1398 mfa = self.manifest.readflags(man)
1399 1399
1400 modified, added, removed, deleted, unknown = self.changes() 1400 modified, added, removed, deleted, unknown = self.changes()
1401 1401
1402 # is this a jump, or a merge? i.e. is there a linear path
1403 # from p1 to p2?
1404 linear_path = (pa == p1 or pa == p2)
1405
1406 if allow and linear_path:
1407 raise util.Abort(_("there is nothing to merge, "
1408 "just use 'hg update'"))
1402 if allow and not forcemerge: 1409 if allow and not forcemerge:
1403 if modified or added or removed: 1410 if modified or added or removed:
1404 raise util.Abort(_("outstanding uncommited changes")) 1411 raise util.Abort(_("outstanding uncommited changes"))
1405 if not forcemerge and not force: 1412 if not forcemerge and not force:
1406 for f in unknown: 1413 for f in unknown:
1408 t1 = self.wread(f) 1415 t1 = self.wread(f)
1409 t2 = self.file(f).read(m2[f]) 1416 t2 = self.file(f).read(m2[f])
1410 if cmp(t1, t2) != 0: 1417 if cmp(t1, t2) != 0:
1411 raise util.Abort(_("'%s' already exists in the working" 1418 raise util.Abort(_("'%s' already exists in the working"
1412 " dir and differs from remote") % f) 1419 " dir and differs from remote") % f)
1413
1414 # is this a jump, or a merge? i.e. is there a linear path
1415 # from p1 to p2?
1416 linear_path = (pa == p1 or pa == p2)
1417 1420
1418 # resolve the manifest to determine which files 1421 # resolve the manifest to determine which files
1419 # we care about merging 1422 # we care about merging
1420 self.ui.note(_("resolving manifests\n")) 1423 self.ui.note(_("resolving manifests\n"))
1421 self.ui.debug(_(" force %s allow %s moddirstate %s linear %s\n") % 1424 self.ui.debug(_(" force %s allow %s moddirstate %s linear %s\n") %