Mercurial > hg
changeset 3596:0611e851b9db
merge with crew
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Tue, 31 Oct 2006 13:22:05 +0100 |
parents | fc34fd58ae7b (diff) 231e61de692c (current diff) |
children | 0d253ec988a6 |
files | |
diffstat | 7 files changed, 20 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/context.py Tue Oct 31 10:50:16 2006 +0100 +++ b/mercurial/context.py Tue Oct 31 13:22:05 2006 +0100 @@ -203,7 +203,7 @@ def data(self): return self._filelog.read(self._filenode) def renamed(self): return self._filelog.renamed(self._filenode) def path(self): return self._path - def size(self): return self._filelog.len(self._filerev) + def size(self): return self._filelog.size(self._filerev) def cmp(self, text): return self._filelog.cmp(self._filenode, text)
--- a/mercurial/filelog.py Tue Oct 31 10:50:16 2006 +0100 +++ b/mercurial/filelog.py Tue Oct 31 13:22:05 2006 +0100 @@ -65,15 +65,15 @@ return (m["copy"], bin(m["copyrev"])) return False - def len(self, rev): - """return the len of a given revision""" + def size(self, rev): + """return the size of a given revision""" # for revisions with renames, we have to go the slow way node = self.node(rev) if self.renamed(node): return len(self.read(node)) - return self.size(rev) + return revlog.size(self, rev) def cmp(self, node, text): """compare text with a given file revision"""
--- a/mercurial/hgweb/hgweb_mod.py Tue Oct 31 10:50:16 2006 +0100 +++ b/mercurial/hgweb/hgweb_mod.py Tue Oct 31 13:22:05 2006 +0100 @@ -441,13 +441,13 @@ files = {} - p = path[1:] - if p and p[-1] != "/": - p += "/" - l = len(p) + if path and path[-1] != "/": + path += "/" + l = len(path) + abspath = "/" + path for f,n in mf.items(): - if f[:l] != p: + if f[:l] != path: continue remain = f[l:] if "/" in remain: @@ -483,15 +483,15 @@ continue yield {"parity": self.stripes(parity), - "path": os.path.join(path, f), + "path": os.path.join(abspath, f), "basename": f[:-1]} parity += 1 yield self.t("manifest", rev=ctx.rev(), node=hex(node), - path=path, - up=_up(path), + path=abspath, + up=_up(abspath), fentries=filelist, dentries=dirlist, archives=self.archivelist(hex(node))) @@ -639,6 +639,7 @@ # find tag, changeset, file def cleanpath(self, path): + path = path.lstrip('/') return util.canonpath(self.repo.root, '', path) def run(self): @@ -865,16 +866,15 @@ self.do_changeset(req) def do_file(self, req): - path = req.form.get('file', [''])[0] + path = self.cleanpath(req.form.get('file', [''])[0]) if path: try: req.write(self.filerevision(self.filectx(req))) return except hg.RepoError: pass - path = self.cleanpath(path) - req.write(self.manifest(self.changectx(req), '/' + path)) + req.write(self.manifest(self.changectx(req), path)) def do_diff(self, req): self.do_filediff(req)
--- a/mercurial/merge.py Tue Oct 31 10:50:16 2006 +0100 +++ b/mercurial/merge.py Tue Oct 31 13:22:05 2006 +0100 @@ -384,13 +384,9 @@ if branchmerge: raise util.Abort(_("there is nothing to merge, just use " "'hg update' or look at 'hg heads'")) - elif not branchmerge: - if not overwrite: - if wc.files(): - raise util.Abort(_("outstanding uncommited changes, use " - "'hg update -C' to lose changes")) - else: - overwrite = True + elif not (overwrite or branchmerge): + raise util.Abort(_("update spans branches, use 'hg merge' " + "or 'hg update -C' to lose changes")) if branchmerge and not forcemerge: if wc.files(): raise util.Abort(_("outstanding uncommitted changes"))
--- a/tests/test-merge5 Tue Oct 31 10:50:16 2006 +0100 +++ b/tests/test-merge5 Tue Oct 31 13:22:05 2006 +0100 @@ -12,13 +12,9 @@ hg update 0 rm b hg commit -A -m"comment #2" -d "1000000 0" - -echo This is file a > a # in theory, we shouldn't need the "-y" below, but it prevents # this test from hanging when "hg update" erroneously prompts the # user for "keep or delete" -hg update -y 1 # should fail (unclean repo) -hg revert a hg update -y 1 exit 0
--- a/tests/test-merge5.out Tue Oct 31 10:50:16 2006 +0100 +++ b/tests/test-merge5.out Tue Oct 31 13:22:05 2006 +0100 @@ -1,4 +1,3 @@ 1 files updated, 0 files merged, 0 files removed, 0 files unresolved removing b -abort: outstanding uncommited changes, use 'hg update -C' to lose changes -1 files updated, 0 files merged, 0 files removed, 0 files unresolved +abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes
--- a/tests/test-up-local-change.out Tue Oct 31 10:50:16 2006 +0100 +++ b/tests/test-up-local-change.out Tue Oct 31 13:22:05 2006 +0100 @@ -93,7 +93,7 @@ date: Mon Jan 12 13:46:40 1970 +0000 summary: 2 -abort: outstanding uncommited changes, use 'hg update -C' to lose changes +abort: update spans branches, use 'hg merge' or 'hg update -C' to lose changes failed abort: outstanding uncommitted changes failed