# HG changeset patch # User Matt Mackall # Date 1227651862 21600 # Node ID 040484030491f2752adba4a14cea1eec0da42ee0 # Parent 5751631246def6a633d47cd9fb1fcc6688abb97b# Parent 0b6428da1f22c2b86a2e678957ec978fb36c9f6c Merge with crew diff -r 5751631246de -r 040484030491 hgext/inotify/__init__.py --- a/hgext/inotify/__init__.py Tue Nov 18 16:02:14 2008 -0600 +++ b/hgext/inotify/__init__.py Tue Nov 25 16:24:22 2008 -0600 @@ -52,6 +52,8 @@ def status(self, match, ignored, clean, unknown=True): files = match.files() + if '.' in files: + files = [] try: if not ignored and not self.inotifyserver: result = client.query(ui, repo, files, match, False, diff -r 5751631246de -r 040484030491 hgext/keyword.py --- a/hgext/keyword.py Tue Nov 18 16:02:14 2008 -0600 +++ b/hgext/keyword.py Tue Nov 25 16:24:22 2008 -0600 @@ -487,10 +487,10 @@ del wlock, lock # monkeypatches - def kwpatchfile_init(orig, self, ui, fname, missing=False): + def kwpatchfile_init(orig, self, ui, fname, opener, missing=False): '''Monkeypatch/wrap patch.patchfile.__init__ to avoid rejects or conflicts due to expanded keywords in working dir.''' - orig(self, ui, fname, missing) + orig(self, ui, fname, opener, missing) # shrink keywords read from working dir self.lines = kwt.shrinklines(self.fname, self.lines) diff -r 5751631246de -r 040484030491 hgext/mq.py --- a/hgext/mq.py Tue Nov 18 16:02:14 2008 -0600 +++ b/hgext/mq.py Tue Nov 25 16:24:22 2008 -0600 @@ -56,6 +56,67 @@ def __str__(self): return self.rev + ':' + self.name +class patchheader(object): + def __init__(self, message, comments, user, date, haspatch): + self.message = message + self.comments = comments + self.user = user + self.date = date + self.haspatch = haspatch + + def setuser(self, user): + if not self.setheader(['From: ', '# User '], user): + try: + patchheaderat = self.comments.index('# HG changeset patch') + self.comments.insert(patchheaderat + 1,'# User ' + user) + except ValueError: + self.comments = ['From: ' + user, ''] + self.comments + self.user = user + + def setdate(self, date): + if self.setheader(['# Date '], date): + self.date = date + + def setmessage(self, message): + if self.comments: + self._delmsg() + self.message = [message] + self.comments += self.message + + def setheader(self, prefixes, new): + '''Update all references to a field in the patch header. + If none found, add it email style.''' + res = False + for prefix in prefixes: + for i in xrange(len(self.comments)): + if self.comments[i].startswith(prefix): + self.comments[i] = prefix + new + res = True + break + return res + + def __str__(self): + if not self.comments: + return '' + return '\n'.join(self.comments) + '\n\n' + + def _delmsg(self): + '''Remove existing message, keeping the rest of the comments fields. + If comments contains 'subject: ', message will prepend + the field and a blank line.''' + if self.message: + subj = 'subject: ' + self.message[0].lower() + for i in xrange(len(self.comments)): + if subj == self.comments[i].lower(): + del self.comments[i] + self.message = self.message[2:] + break + ci = 0 + for mi in xrange(len(self.message)): + while self.message[mi] != self.comments[ci]: + ci += 1 + del self.comments[ci] + class queue: def __init__(self, ui, path, patchdir=None): self.basepath = path @@ -307,7 +368,7 @@ if format and format.startswith("tag") and subject: message.insert(0, "") message.insert(0, subject) - return (message, comments, user, date, diffstart > 1) + return patchheader(message, comments, user, date, diffstart > 1) def removeundo(self, repo): undo = repo.sjoin('undo') @@ -351,13 +412,13 @@ if n == None: raise util.Abort(_("repo commit failed")) try: - message, comments, user, date, patchfound = mergeq.readheaders(patch) + ph = mergeq.readheaders(patch) except: raise util.Abort(_("unable to read %s") % patch) patchf = self.opener(patch, "w") + comments = str(ph) if comments: - comments = "\n".join(comments) + '\n\n' patchf.write(comments) self.printdiff(repo, head, n, fp=patchf) patchf.close() @@ -477,12 +538,13 @@ pf = os.path.join(patchdir, patchname) try: - message, comments, user, date, patchfound = self.readheaders(patchname) + ph = self.readheaders(patchname) except: self.ui.warn(_("Unable to read %s\n") % patchname) err = 1 break + message = ph.message if not message: message = _("imported patch %s\n") % patchname else: @@ -512,7 +574,7 @@ files = patch.updatedir(self.ui, repo, files) match = cmdutil.matchfiles(repo, files or []) - n = repo.commit(files, message, user, date, match=match, + n = repo.commit(files, message, ph.user, ph.date, match=match, force=True) if n == None: @@ -522,7 +584,7 @@ self.applied.append(statusentry(revlog.hex(n), patchname)) if patcherr: - if not patchfound: + if not ph.haspatch: self.ui.warn(_("patch %s is empty\n") % patchname) err = 0 else: @@ -824,11 +886,15 @@ raise util.Abort(_("patch %s not in series") % patch) def push(self, repo, patch=None, force=False, list=False, - mergeq=None): + mergeq=None, all=False): wlock = repo.wlock() if repo.dirstate.parents()[0] != repo.changelog.tip(): self.ui.status(_("(working directory not at tip)\n")) + if not self.series: + self.ui.warn(_('no patches in series\n')) + return 0 + try: patch = self.lookup(patch) # Suppose our series file is: A B C and the current 'top' @@ -841,26 +907,36 @@ if info[0] < len(self.applied) - 1: raise util.Abort( _("cannot push to a previous patch: %s") % patch) - if info[0] < len(self.series) - 1: - self.ui.warn( - _('qpush: %s is already at the top\n') % patch) + self.ui.warn( + _('qpush: %s is already at the top\n') % patch) + return + pushable, reason = self.pushable(patch) + if not pushable: + if reason: + reason = _('guarded by %r') % reason else: - self.ui.warn(_('all patches are currently applied\n')) - return + reason = _('no matching guards') + self.ui.warn(_("cannot push '%s' - %s\n") % (patch, reason)) + return 1 + elif all: + patch = self.series[-1] + if self.isapplied(patch): + self.ui.warn(_('all patches are currently applied\n')) + return 0 # Following the above example, starting at 'top' of B: # qpush should be performed (pushes C), but a subsequent # qpush without an argument is an error (nothing to # apply). This allows a loop of "...while hg qpush..." to # work as it detects an error when done - if self.series_end() == len(self.series): + start = self.series_end() + if start == len(self.series): self.ui.warn(_('patch series already fully applied\n')) return 1 if not force: self.check_localchanges(repo) - self.applied_dirty = 1; - start = self.series_end() + self.applied_dirty = 1 if start > 0: self.check_toppatch(repo) if not patch: @@ -1001,6 +1077,8 @@ if len(self.applied) == 0: self.ui.write(_("No patches applied\n")) return 1 + msg = opts.get('msg', '').rstrip() + newuser = opts.get('user') newdate = opts.get('date') if newdate: newdate = '%d %d' % util.parsedate(newdate) @@ -1013,9 +1091,9 @@ raise util.Abort(_("cannot refresh a revision with children")) cparents = repo.changelog.parents(top) patchparent = self.qparents(repo, top) - message, comments, user, date, patchfound = self.readheaders(patchfn) + ph = self.readheaders(patchfn) - patchf = self.opener(patchfn, 'r+') + patchf = self.opener(patchfn, 'r') # if the patch was a git patch, refresh it as a git patch for line in patchf: @@ -1023,59 +1101,21 @@ self.diffopts().git = True break - msg = opts.get('msg', '').rstrip() - if msg and comments: - # Remove existing message, keeping the rest of the comments - # fields. - # If comments contains 'subject: ', message will prepend - # the field and a blank line. - if message: - subj = 'subject: ' + message[0].lower() - for i in xrange(len(comments)): - if subj == comments[i].lower(): - del comments[i] - message = message[2:] - break - ci = 0 - for mi in xrange(len(message)): - while message[mi] != comments[ci]: - ci += 1 - del comments[ci] + if msg: + ph.setmessage(msg) + if newuser: + ph.setuser(newuser) + if newdate: + ph.setdate(newdate) - def setheaderfield(comments, prefixes, new): - # Update all references to a field in the patch header. - # If none found, add it email style. - res = False - for prefix in prefixes: - for i in xrange(len(comments)): - if comments[i].startswith(prefix): - comments[i] = prefix + new - res = True - break - return res - - newuser = opts.get('user') - if newuser: - if not setheaderfield(comments, ['From: ', '# User '], newuser): - try: - patchheaderat = comments.index('# HG changeset patch') - comments.insert(patchheaderat + 1,'# User ' + newuser) - except ValueError: - comments = ['From: ' + newuser, ''] + comments - user = newuser - - if newdate: - if setheaderfield(comments, ['# Date '], newdate): - date = newdate - - if msg: - comments.append(msg) + # only commit new patch when write is complete + patchf = self.opener(patchfn, 'w', atomictemp=True) patchf.seek(0) patchf.truncate() + comments = str(ph) if comments: - comments = "\n".join(comments) + '\n\n' patchf.write(comments) if opts.get('git'): @@ -1148,69 +1188,82 @@ changes=c, opts=self.diffopts()) for chunk in chunks: patchf.write(chunk) - patchf.close() - repo.dirstate.setparents(*cparents) - copies = {} - for dst in a: - src = repo.dirstate.copied(dst) - if src is not None: - copies.setdefault(src, []).append(dst) - repo.dirstate.add(dst) - # remember the copies between patchparent and tip - # this may be slow, so don't do it if we're not tracking copies - if self.diffopts().git: - for dst in aaa: - f = repo.file(dst) - src = f.renamed(man[dst]) - if src: - copies.setdefault(src[0], []).extend(copies.get(dst, [])) - if dst in a: - copies[src[0]].append(dst) - # we can't copy a file created by the patch itself - if dst in copies: - del copies[dst] - for src, dsts in copies.iteritems(): - for dst in dsts: - repo.dirstate.copy(src, dst) - for f in r: - repo.dirstate.remove(f) - # if the patch excludes a modified file, mark that - # file with mtime=0 so status can see it. - mm = [] - for i in xrange(len(m)-1, -1, -1): - if not matchfn(m[i]): - mm.append(m[i]) - del m[i] - for f in m: - repo.dirstate.normal(f) - for f in mm: - repo.dirstate.normallookup(f) - for f in forget: - repo.dirstate.forget(f) + try: + copies = {} + for dst in a: + src = repo.dirstate.copied(dst) + if src is not None: + copies.setdefault(src, []).append(dst) + repo.dirstate.add(dst) + # remember the copies between patchparent and tip + # this may be slow, so don't do it if we're not tracking copies + if self.diffopts().git: + for dst in aaa: + f = repo.file(dst) + src = f.renamed(man[dst]) + if src: + copies.setdefault(src[0], []).extend(copies.get(dst, [])) + if dst in a: + copies[src[0]].append(dst) + # we can't copy a file created by the patch itself + if dst in copies: + del copies[dst] + for src, dsts in copies.iteritems(): + for dst in dsts: + repo.dirstate.copy(src, dst) + for f in r: + repo.dirstate.remove(f) + # if the patch excludes a modified file, mark that + # file with mtime=0 so status can see it. + mm = [] + for i in xrange(len(m)-1, -1, -1): + if not matchfn(m[i]): + mm.append(m[i]) + del m[i] + for f in m: + repo.dirstate.normal(f) + for f in mm: + repo.dirstate.normallookup(f) + for f in forget: + repo.dirstate.forget(f) - if not msg: - if not message: - message = "[mq]: %s\n" % patchfn + if not msg: + if not ph.message: + message = "[mq]: %s\n" % patchfn + else: + message = "\n".join(ph.message) else: - message = "\n".join(message) - else: - message = msg + message = msg + + user = ph.user or changes[1] - if not user: - user = changes[1] + # assumes strip can roll itself back if interrupted + repo.dirstate.setparents(*cparents) + self.applied.pop() + self.applied_dirty = 1 + self.strip(repo, top, update=False, + backup='strip') + except: + repo.dirstate.invalidate() + raise - self.applied.pop() - self.applied_dirty = 1 - self.strip(repo, top, update=False, - backup='strip') - n = repo.commit(match.files(), message, user, date, match=match, - force=1) - self.applied.append(statusentry(revlog.hex(n), patchfn)) - self.removeundo(repo) + try: + # might be nice to attempt to roll back strip after this + patchf.rename() + n = repo.commit(match.files(), message, user, ph.date, + match=match, force=1) + self.applied.append(statusentry(revlog.hex(n), patchfn)) + except: + ctx = repo[cparents[0]] + repo.dirstate.rebuild(ctx.node(), ctx.manifest()) + self.save_dirty() + self.ui.warn(_('refresh interrupted while patch was popped! ' + '(revert --all, qpush to recover)\n')) + raise else: self.printdiff(repo, patchparent, fp=patchf) - patchf.close() + patchf.rename() added = repo.status()[1] for a in added: f = repo.wjoin(a) @@ -1228,6 +1281,7 @@ self.push(repo, force=True) finally: del wlock + self.removeundo(repo) def init(self, repo, create=False): if not create and os.path.isdir(self.path): @@ -1259,7 +1313,8 @@ summary=False): def displayname(patchname): if summary: - msg = self.readheaders(patchname)[0] + ph = self.readheaders(patchname) + msg = ph.message msg = msg and ': ' + msg[0] or ': ' else: msg = '' @@ -1815,8 +1870,8 @@ if message: raise util.Abort(_('option "-e" incompatible with "-m" or "-l"')) patch = q.applied[-1].name - (message, comment, user, date, hasdiff) = q.readheaders(patch) - message = ui.edit('\n'.join(message), user or ui.username()) + ph = q.readheaders(patch) + message = ui.edit('\n'.join(ph.message), ph.user or ui.username()) setupheaderopts(ui, opts) ret = q.refresh(repo, pats, msg=message, **opts) q.save_dirty() @@ -1874,7 +1929,8 @@ for p in patches: if not message: - messages.append(q.readheaders(p)[0]) + ph = q.readheaders(p) + messages.append(ph.message) pf = q.join(p) (patchsuccess, files, fuzz) = q.patch(repo, pf) if not patchsuccess: @@ -1882,7 +1938,8 @@ patch.updatedir(ui, repo, files) if not message: - message, comments, user = q.readheaders(parent)[0:3] + ph = q.readheaders(parent) + message, user = ph.message, ph.user for msg in messages: message.append('* * *') message.extend(msg) @@ -1965,9 +2022,9 @@ ui.write('No patches applied\n') return 1 patch = q.lookup('qtip') - message = repo.mq.readheaders(patch)[0] + ph = repo.mq.readheaders(patch) - ui.write('\n'.join(message) + '\n') + ui.write('\n'.join(ph.message) + '\n') def lastsavename(path): (directory, base) = os.path.split(path) @@ -2001,11 +2058,6 @@ q = repo.mq mergeq = None - if opts['all']: - if not q.series: - ui.warn(_('no patches in series\n')) - return 0 - patch = q.series[-1] if opts['merge']: if opts['name']: newpath = repo.join(opts['name']) @@ -2017,7 +2069,7 @@ mergeq = queue(ui, repo.join(""), newpath) ui.warn(_("merging with queue at: %s\n") % mergeq.path) ret = q.push(repo, patch, force=opts['force'], list=opts['list'], - mergeq=mergeq) + mergeq=mergeq, all=opts.get('all')) return ret def pop(ui, repo, patch=None, **opts): diff -r 5751631246de -r 040484030491 hgext/patchbomb.py --- a/hgext/patchbomb.py Tue Nov 18 16:02:14 2008 -0600 +++ b/hgext/patchbomb.py Tue Nov 25 16:24:22 2008 -0600 @@ -402,6 +402,7 @@ m['Message-Id'] = genmsgid('patchbomb') if parent: m['In-Reply-To'] = parent + m['References'] = parent else: parent = m['Message-Id'] m['Date'] = util.datestr(start_time, "%a, %d %b %Y %H:%M:%S %1%2") diff -r 5751631246de -r 040484030491 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/cmdutil.py Tue Nov 25 16:24:22 2008 -0600 @@ -1033,6 +1033,8 @@ if node is None: # A zero count may be a directory or deleted file, so # try to find matching entries on the slow path. + if follow: + raise util.Abort(_('cannot follow nonexistent file: "%s"') % file_) slowpath = True break else: diff -r 5751631246de -r 040484030491 mercurial/commands.py --- a/mercurial/commands.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/commands.py Tue Nov 25 16:24:22 2008 -0600 @@ -1581,6 +1581,9 @@ recorded in the patch. This may happen due to character set problems or other deficiencies in the text patch format. + With --similarity, hg will attempt to discover renames and copies + in the patch in the same way as 'addremove'. + To read a patch from standard input, use patch name "-". See 'hg help dates' for a list of formats valid for -d/--date. """ @@ -1590,6 +1593,13 @@ if date: opts['date'] = util.parsedate(date) + try: + sim = float(opts.get('similarity') or 0) + except ValueError: + raise util.Abort(_('similarity must be a number')) + if sim < 0 or sim > 100: + raise util.Abort(_('similarity must be between 0 and 100')) + if opts.get('exact') or not opts.get('force'): cmdutil.bail_if_changed(repo) @@ -1653,7 +1663,7 @@ fuzz = patch.patch(tmpname, ui, strip=strip, cwd=repo.root, files=files) finally: - files = patch.updatedir(ui, repo, files) + files = patch.updatedir(ui, repo, files, similarity=sim/100.) if not opts.get('no_commit'): n = repo.commit(files, message, opts.get('user') or user, opts.get('date') or date) @@ -3003,13 +3013,15 @@ ('U', 'unified', '', _('number of lines of context to show')) ] +similarityopts = [ + ('s', 'similarity', '', + _('guess renamed files by similarity (0<=s<=100)')) +] + table = { "^add": (add, walkopts + dryrunopts, _('[OPTION]... [FILE]...')), "addremove": - (addremove, - [('s', 'similarity', '', - _('guess renamed files by similarity (0<=s<=100)')), - ] + walkopts + dryrunopts, + (addremove, similarityopts + walkopts + dryrunopts, _('[OPTION]... [FILE]...')), "^annotate|blame": (annotate, @@ -3192,7 +3204,7 @@ _('apply patch to the nodes from which it was generated')), ('', 'import-branch', None, _('Use any branch information in patch (implied by --exact)'))] + - commitopts + commitopts2, + commitopts + commitopts2 + similarityopts, _('[OPTION]... PATCH...')), "incoming|in": (incoming, diff -r 5751631246de -r 040484030491 mercurial/filemerge.py --- a/mercurial/filemerge.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/filemerge.py Tue Nov 25 16:24:22 2008 -0600 @@ -32,8 +32,11 @@ tmsg = tool if pat: tmsg += " specified for " + pat - if pat and not _findtool(ui, tool): # skip search if not matching - ui.warn(_("couldn't find merge tool %s\n") % tmsg) + if not _findtool(ui, tool): + if pat: # explicitly requested tool deserves a warning + ui.warn(_("couldn't find merge tool %s\n") % tmsg) + else: # configured but non-existing tools are more silent + ui.note(_("couldn't find merge tool %s\n") % tmsg) elif symlink and not _toolbool(ui, tool, "symlink"): ui.warn(_("tool %s can't handle symlinks\n") % tmsg) elif binary and not _toolbool(ui, tool, "binary"): @@ -71,8 +74,8 @@ tools.insert(0, (None, uimerge)) # highest priority tools.append((None, "hgmerge")) # the old default, if found for p,t in tools: - toolpath = _findtool(ui, t) - if toolpath and check(t, None, symlink, binary): + if check(t, None, symlink, binary): + toolpath = _findtool(ui, t) return (t, '"' + toolpath + '"') # internal merge as last resort return (not (symlink or binary) and "internal:merge" or None, None) diff -r 5751631246de -r 040484030491 mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/hgweb/hgweb_mod.py Tue Nov 25 16:24:22 2008 -0600 @@ -182,20 +182,20 @@ content = getattr(webcommands, cmd)(self, req, tmpl) req.respond(HTTP_OK, ctype) - return ''.join(content), + return content except revlog.LookupError, err: req.respond(HTTP_NOT_FOUND, ctype) msg = str(err) if 'manifest' not in msg: msg = 'revision not found: %s' % err.name - return ''.join(tmpl('error', error=msg)), + return tmpl('error', error=msg) except (RepoError, revlog.RevlogError), inst: req.respond(HTTP_SERVER_ERROR, ctype) - return ''.join(tmpl('error', error=str(inst))), + return tmpl('error', error=str(inst)) except ErrorResponse, inst: req.respond(inst.code, ctype) - return ''.join(tmpl('error', error=inst.message)), + return tmpl('error', error=inst.message) def templater(self, req): diff -r 5751631246de -r 040484030491 mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/hgweb/hgwebdir_mod.py Tue Nov 25 16:24:22 2008 -0600 @@ -116,7 +116,7 @@ # top-level index elif not virtual: req.respond(HTTP_OK, ctype) - return ''.join(self.makeindex(req, tmpl)), + return self.makeindex(req, tmpl) # nested indexes and hgwebs @@ -138,7 +138,7 @@ subdir = virtual + '/' if [r for r in repos if r.startswith(subdir)]: req.respond(HTTP_OK, ctype) - return ''.join(self.makeindex(req, tmpl, subdir)), + return self.makeindex(req, tmpl, subdir) up = virtual.rfind('/') if up < 0: @@ -147,11 +147,11 @@ # prefixes not found req.respond(HTTP_NOT_FOUND, ctype) - return ''.join(tmpl("notfound", repo=virtual)), + return tmpl("notfound", repo=virtual) except ErrorResponse, err: req.respond(err.code, ctype) - return ''.join(tmpl('error', error=err.message or '')), + return tmpl('error', error=err.message or '') finally: tmpl = None diff -r 5751631246de -r 040484030491 mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/hgweb/webcommands.py Tue Nov 25 16:24:22 2008 -0600 @@ -227,6 +227,7 @@ def changeset(web, req, tmpl): ctx = webutil.changectx(web.repo, req) showtags = webutil.showtag(web.repo, tmpl, 'changesettag', ctx.node()) + showbranch = webutil.nodebranchnodefault(ctx) parents = ctx.parents() files = [] @@ -246,6 +247,7 @@ parent=webutil.siblings(parents), child=webutil.siblings(ctx.children()), changesettag=showtags, + changesetbranch=showbranch, author=ctx.user(), desc=ctx.description(), date=ctx.date(), @@ -555,8 +557,12 @@ "rename": webutil.renamelink(fctx), "parent": webutil.siblings(fctx.parents()), "child": webutil.siblings(fctx.children()), - "desc": ctx.description()}) - + "desc": ctx.description(), + "tags": webutil.nodetagsdict(web.repo, ctx.node()), + "branch": webutil.nodebranchnodefault(ctx), + "inbranch": webutil.nodeinbranch(web.repo, ctx), + "branches": webutil.nodebranchdict(web.repo, ctx)}) + if limit > 0: l = l[:limit] diff -r 5751631246de -r 040484030491 mercurial/hgweb/wsgicgi.py --- a/mercurial/hgweb/wsgicgi.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/hgweb/wsgicgi.py Tue Nov 25 16:24:22 2008 -0600 @@ -17,6 +17,9 @@ environ = dict(os.environ.items()) environ.setdefault('PATH_INFO', '') + if '.cgi' in environ['PATH_INFO']: + environ['PATH_INFO'] = environ['PATH_INFO'].split('.cgi', 1)[1] + environ['wsgi.input'] = sys.stdin environ['wsgi.errors'] = sys.stderr environ['wsgi.version'] = (1, 0) diff -r 5751631246de -r 040484030491 mercurial/manifest.py --- a/mercurial/manifest.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/manifest.py Tue Nov 25 16:24:22 2008 -0600 @@ -63,6 +63,8 @@ while i < lenm and m[i] != c: i += 1 return i + if not s: + return (lo, lo) lenm = len(m) if not hi: hi = lenm diff -r 5751631246de -r 040484030491 mercurial/patch.py --- a/mercurial/patch.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/patch.py Tue Nov 25 16:24:22 2008 -0600 @@ -228,27 +228,22 @@ contextdesc = re.compile('(---|\*\*\*) (\d+)(,(\d+))? (---|\*\*\*)') class patchfile: - def __init__(self, ui, fname, missing=False): + def __init__(self, ui, fname, opener, missing=False): self.fname = fname + self.opener = opener self.ui = ui self.lines = [] self.exists = False self.missing = missing if not missing: try: - fp = file(fname, 'rb') - self.lines = fp.readlines() + self.lines = self.readlines(fname) self.exists = True except IOError: pass else: self.ui.warn(_("unable to find '%s' for patching\n") % self.fname) - if not self.exists: - dirname = os.path.dirname(fname) - if dirname and not os.path.isdir(dirname): - os.makedirs(dirname) - self.hash = {} self.dirty = 0 self.offset = 0 @@ -257,6 +252,23 @@ self.printfile(False) self.hunks = 0 + def readlines(self, fname): + fp = self.opener(fname, 'r') + try: + return fp.readlines() + finally: + fp.close() + + def writelines(self, fname, lines): + fp = self.opener(fname, 'w') + try: + fp.writelines(lines) + finally: + fp.close() + + def unlink(self, fname): + os.unlink(fname) + def printfile(self, warn): if self.fileprinted: return @@ -307,35 +319,24 @@ self.ui.warn( _("%d out of %d hunks FAILED -- saving rejects to file %s\n") % (len(self.rej), self.hunks, fname)) - try: os.unlink(fname) - except: - pass - fp = file(fname, 'wb') - base = os.path.basename(self.fname) - fp.write("--- %s\n+++ %s\n" % (base, base)) - for x in self.rej: - for l in x.hunk: - fp.write(l) - if l[-1] != '\n': - fp.write("\n\ No newline at end of file\n") + + def rejlines(): + base = os.path.basename(self.fname) + yield "--- %s\n+++ %s\n" % (base, base) + for x in self.rej: + for l in x.hunk: + yield l + if l[-1] != '\n': + yield "\n\ No newline at end of file\n" + + self.writelines(fname, rejlines()) def write(self, dest=None): - if self.dirty: - if not dest: - dest = self.fname - st = None - try: - st = os.lstat(dest) - except OSError, inst: - if inst.errno != errno.ENOENT: - raise - if st and st.st_nlink > 1: - os.unlink(dest) - fp = file(dest, 'wb') - if st and st.st_nlink > 1: - os.chmod(dest, st.st_mode) - fp.writelines(self.lines) - fp.close() + if not self.dirty: + return + if not dest: + dest = self.fname + self.writelines(dest, self.lines) def close(self): self.write() @@ -362,7 +363,7 @@ if isinstance(h, binhunk): if h.rmfile(): - os.unlink(self.fname) + self.unlink(self.fname) else: self.lines[:] = h.new() self.offset += len(h.new()) @@ -379,7 +380,7 @@ orig_start = start if diffhelpers.testhunk(old, self.lines, start) == 0: if h.rmfile(): - os.unlink(self.fname) + self.unlink(self.fname) else: self.lines[start : start + h.lena] = h.new() self.offset += h.lenb - h.lena @@ -938,6 +939,7 @@ err = 0 current_file = None gitpatches = None + opener = util.opener(os.getcwd()) def closefile(): if not current_file: @@ -960,11 +962,11 @@ afile, bfile, first_hunk = values try: if sourcefile: - current_file = patchfile(ui, sourcefile) + current_file = patchfile(ui, sourcefile, opener) else: current_file, missing = selectfile(afile, bfile, first_hunk, strip, reverse) - current_file = patchfile(ui, current_file, missing) + current_file = patchfile(ui, current_file, opener, missing) except PatchError, err: ui.warn(str(err) + '\n') current_file, current_hunk = None, None @@ -1002,7 +1004,7 @@ ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), context=get('unified', getter=ui.config)) -def updatedir(ui, repo, patches): +def updatedir(ui, repo, patches, similarity=0): '''Update dirstate after patch application according to metadata''' if not patches: return @@ -1026,7 +1028,7 @@ for src, dst in copies: repo.copy(src, dst) removes = removes.keys() - if removes: + if (not similarity) and removes: repo.remove(util.sort(removes), True) for f in patches: gp = patches[f] @@ -1039,7 +1041,7 @@ repo.wwrite(gp.path, '', flags) else: util.set_flags(dst, islink, isexec) - cmdutil.addremove(repo, cfiles) + cmdutil.addremove(repo, cfiles, similarity=similarity) files = patches.keys() files.extend([r for r in removes if r not in files]) return util.sort(files) diff -r 5751631246de -r 040484030491 mercurial/templater.py --- a/mercurial/templater.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/templater.py Tue Nov 25 16:24:22 2008 -0600 @@ -44,7 +44,8 @@ template_re = re.compile(r"(?:(?:#(?=[\w\|%]+#))|(?:{(?=[\w\|%]+})))" r"(\w+)(?:(?:%(\w+))|((?:\|\w+)*))[#}]") - def __init__(self, mapfile, filters={}, defaults={}, cache={}): + def __init__(self, mapfile, filters={}, defaults={}, cache={}, + minchunk=1024, maxchunk=65536): '''set up template engine. mapfile is name of file to read map definitions from. filters is dict of functions. each transforms a value into another. @@ -55,6 +56,7 @@ self.base = (mapfile and os.path.dirname(mapfile)) or '' self.filters = filters self.defaults = defaults + self.minchunk, self.maxchunk = minchunk, maxchunk if not mapfile: return @@ -130,6 +132,13 @@ yield v def __call__(self, t, **map): + stream = self.expand(t, **map) + if self.minchunk: + stream = util.increasingchunks(stream, min=self.minchunk, + max=self.maxchunk) + return stream + + def expand(self, t, **map): '''Perform expansion. t is name of map element to expand. map contains added elements for use during expansion. Is a generator.''' tmpl = self._template(t) diff -r 5751631246de -r 040484030491 mercurial/util.py --- a/mercurial/util.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/util.py Tue Nov 25 16:24:22 2008 -0600 @@ -290,6 +290,37 @@ l.sort() return l +def increasingchunks(source, min=1024, max=65536): + '''return no less than min bytes per chunk while data remains, + doubling min after each chunk until it reaches max''' + def log2(x): + if not x: + return 0 + i = 0 + while x: + x >>= 1 + i += 1 + return i - 1 + + buf = [] + blen = 0 + for chunk in source: + buf.append(chunk) + blen += len(chunk) + if blen >= min: + if min < max: + min = min << 1 + nmin = 1 << log2(blen) + if nmin > min: + min = nmin + if min > max: + min = max + yield ''.join(buf) + blen = 0 + buf = [] + if buf: + yield ''.join(buf) + class Abort(Exception): """Raised if a command needs to print an error and exit.""" diff -r 5751631246de -r 040484030491 mercurial/util_win32.py --- a/mercurial/util_win32.py Tue Nov 18 16:02:14 2008 -0600 +++ b/mercurial/util_win32.py Tue Nov 25 16:24:22 2008 -0600 @@ -292,7 +292,7 @@ raise WinIOError(err, name) def __iter__(self): - for line in self.read().splitlines(True): + for line in self.readlines(): yield line def read(self, count=-1): @@ -311,6 +311,11 @@ except pywintypes.error, err: raise WinIOError(err) + def readlines(self, sizehint=None): + # splitlines() splits on single '\r' while readlines() + # does not. cStringIO has a well behaving readlines() and is fast. + return cStringIO.StringIO(self.read()).readlines() + def write(self, data): try: if 'a' in self.mode: diff -r 5751631246de -r 040484030491 templates/coal/changeset.tmpl --- a/templates/coal/changeset.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -{header} -{repo|escape}: {node|short} - - -
- - -
- -

{repo|escape}

-

changeset {rev}:{node|short} {changesettag}

- - - -
{desc|strip|escape|addbreaks}
- - - - - - - - - - - - - - - - - - - - - -
author{author|obfuscate}
date{date|date} ({date|age} ago)
parents{parent%changesetparent}
children{child%changesetchild}
files{files}
- -
- - - - - -
linediff
-{diff} -
- -
-
-{footer} diff -r 5751631246de -r 040484030491 templates/coal/error.tmpl --- a/templates/coal/error.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -{header} -{repo|escape}: error - - - -
- - -
- -

{repo|escape}

-

error

- - - -
-

-An error occurred while processing your request: -

-

-{error|escape} -

-
-
-
- -{footer} diff -r 5751631246de -r 040484030491 templates/coal/fileannotate.tmpl --- a/templates/coal/fileannotate.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -{header} -{repo|escape}: {file|escape} annotate - - - -
- - -
-

{repo|escape}

-

annotate {file|escape} @ {rev}:{node|short}

- - - -
{desc|strip|escape|addbreaks}
- - - - - - - - - - - - - - - - - - -{changesettag} -
author{author|obfuscate}
date{date|date} ({date|age} ago)
parents{parent%filerevparent}
children{child%filerevchild}
- -
- -
- - - - - - -{annotate%annotateline} -
revlinesource
-
-
-
- -{footer} diff -r 5751631246de -r 040484030491 templates/coal/filediff.tmpl --- a/templates/coal/filediff.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -{header} -{repo|escape}: {file|escape} diff - - - -
- - -
-

{repo|escape}

-

diff {file|escape} @ {rev}:{node|short}

- - - -
{desc|strip|escape|addbreaks}
- - - - - - - - - - - - - - - - - - -{changesettag} -
author{author|obfuscate}
date{date|date} ({date|age} ago)
parents{parent%filerevparent}
children{child%filerevchild}
- -
- - - - - -
linediff
- -{diff} -
-
-
- -{footer} diff -r 5751631246de -r 040484030491 templates/coal/filelog.tmpl --- a/templates/coal/filelog.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -{header} -{repo|escape}: {file|escape} history - - - - - -
- - -
-

{repo|escape}

-

log {file|escape}

- - - - - - - - - - - -{entries%filelogentry} -
ageauthordescription
- -
-
- -{footer} diff -r 5751631246de -r 040484030491 templates/coal/filelogentry.tmpl --- a/templates/coal/filelogentry.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - {date|age} - {author|person} - {desc|strip|firstline|escape} - diff -r 5751631246de -r 040484030491 templates/coal/filerevision.tmpl --- a/templates/coal/filerevision.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,75 +0,0 @@ -{header} -{repo|escape}: {node|short} {file|escape} - - - -
- - -
-

{repo|escape}

-

view {file|escape} @ {rev}:{node|short}

- - - -
{desc|strip|escape|addbreaks}
- - - - - - - - - - - - - - - - - - -{changesettag} -
author{author|obfuscate}
date{date|date} ({date|age} ago)
parents{parent%filerevparent}
children{child%filerevchild}
- -
- - - - - -{text%fileline} -
linesource
-
-
-
- -{footer} diff -r 5751631246de -r 040484030491 templates/coal/footer.tmpl --- a/templates/coal/footer.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -{motd} - - - diff -r 5751631246de -r 040484030491 templates/coal/graph.tmpl --- a/templates/coal/graph.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,113 +0,0 @@ -{header} -{repo|escape}: revision graph - - - - - - -
- - -
-

{repo|escape}

-

graph

- - - - - - - -
-
    - -
      -
      - - - - - - -
      -
      - -{footer} diff -r 5751631246de -r 040484030491 templates/coal/index.tmpl --- a/templates/coal/index.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -{header} -Mercurial repositories index - - - -
      - -
      -

      Mercurial Repositories

      - - - - - - - - - - {entries%indexentry} -
      NameDescriptionContactLast change 
      -
      -
      -{footer} diff -r 5751631246de -r 040484030491 templates/coal/manifest.tmpl --- a/templates/coal/manifest.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -{header} -{repo|escape}: {node|short} {path|escape} - - - -
      - - -
      -

      {repo|escape}

      -

      directory {path|escape} @ {rev}:{node|short} {tags%changelogtag}

      - - - - - - - - - - - - - - -{dentries%direntry} -{fentries%fileentry} -
      namesizepermissions
      [up]drwxr-xr-x
      -
      -
      -{footer} diff -r 5751631246de -r 040484030491 templates/coal/map --- a/templates/coal/map Tue Nov 18 16:02:14 2008 -0600 +++ b/templates/coal/map Tue Nov 25 16:24:22 2008 -0600 @@ -2,13 +2,13 @@ mimetype = 'text/html; charset={encoding}' header = header.tmpl -footer = footer.tmpl -search = search.tmpl +footer = ../paper/footer.tmpl +search = ../paper/search.tmpl -changelog = shortlog.tmpl -shortlog = shortlog.tmpl -shortlogentry = shortlogentry.tmpl -graph = graph.tmpl +changelog = ../paper/shortlog.tmpl +shortlog = ../paper/shortlog.tmpl +shortlogentry = ../paper/shortlogentry.tmpl +graph = ../paper/graph.tmpl naventry = '{label|escape} ' navshortentry = '{label|escape} ' @@ -18,28 +18,28 @@ filenodelink = '{file|escape} ' filenolink = '{file|escape} ' fileellipses = '...' -changelogentry = shortlogentry.tmpl -searchentry = shortlogentry.tmpl -changeset = changeset.tmpl -manifest = manifest.tmpl +changelogentry = ../paper/shortlogentry.tmpl +searchentry = ../paper/shortlogentry.tmpl +changeset = ../paper/changeset.tmpl +manifest = ../paper/manifest.tmpl direntry = ' {basename|escape}/ {emptydirs|escape}drwxr-xr-x' fileentry = ' {basename|escape}{size}{permissions|permissions}' -filerevision = filerevision.tmpl -fileannotate = fileannotate.tmpl -filediff = filediff.tmpl -filelog = filelog.tmpl -fileline = '{linenumber}{line|escape}' -filelogentry = filelogentry.tmpl +filerevision = ../paper/filerevision.tmpl +fileannotate = ../paper/fileannotate.tmpl +filediff = ../paper/filediff.tmpl +filelog = ../paper/filelog.tmpl +fileline = '
      {linenumber} {line|escape}
      ' +filelogentry = ../paper/filelogentry.tmpl -annotateline = '{author|user}@{rev}{linenumber}{line|escape}' +annotateline = '{author|user}@{rev}{linenumber} {line|escape}' -diffblock = '{lines}
      ' -difflineplus = '{linenumber}{line|escape}' -difflineminus = '{linenumber}{line|escape}' -difflineat = '{linenumber}{line|escape}' -diffline = '{linenumber}{line|escape}' +diffblock = '
      {lines}
      ' +difflineplus = '{linenumber} {line|escape}' +difflineminus = '{linenumber} {line|escape}' +difflineat = '{linenumber} {line|escape}' +diffline = '{linenumber} {line|escape}' changelogparent = 'parent {rev}:{node|short}' @@ -54,19 +54,21 @@ changesetchild = '{node|short}' changelogchild = 'child{node|short}' fileannotatechild = 'child:{node|short}' -tags = tags.tmpl +tags = ../paper/tags.tmpl tagentry = '{tag|escape}{node|short}' changelogtag = '{name|escape} ' changesettag = '{tag|escape} ' +changelogbranchhead = '{name|escape} ' +changelogbranchname = '{name|escape} ' filediffparent = 'parent {rev}:{node|short}' filelogparent = 'parent {rev}:{node|short}' filediffchild = 'child {rev}:{node|short}' filelogchild = 'child {rev}:{node|short}' indexentry = '{name|escape}{description}{contact|obfuscate}{lastchange|age} ago{archives%indexarchiveentry}\n' indexarchiveentry = ' ↓{type|escape}' -index = index.tmpl +index = ../paper/index.tmpl archiveentry = '
    • {type|escape}
    • ' -notfound = notfound.tmpl -error = error.tmpl +notfound = ../paper/notfound.tmpl +error = ../paper/error.tmpl urlparameter = '{separator}{name}={value|urlescape}' hiddenformentry = '' diff -r 5751631246de -r 040484030491 templates/coal/notfound.tmpl --- a/templates/coal/notfound.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -{header} -Mercurial repository not found - - - -

      Mercurial repository not found

      - -The specified repository "{repo|escape}" is unknown, sorry. - -Please go back to the main repository list page. - -{footer} diff -r 5751631246de -r 040484030491 templates/coal/search.tmpl --- a/templates/coal/search.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -{header} -{repo|escape}: searching for {query|escape} - - - -
      - - -
      -

      {repo|escape}

      -

      searching for '{query|escape}'

      - - - - - - - - - -{entries} -
      ageauthordescription
      - -
      -
      - -{footer} diff -r 5751631246de -r 040484030491 templates/coal/shortlog.tmpl --- a/templates/coal/shortlog.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -{header} -{repo|escape}: log - - - - - -
      - - -
      -

      {repo|escape}

      -

      log

      - - - - - - - - - - - -{entries%shortlogentry} -
      ageauthordescription
      - - -
      -
      - -{footer} diff -r 5751631246de -r 040484030491 templates/coal/shortlogentry.tmpl --- a/templates/coal/shortlogentry.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - {date|age} - {author|person} - {desc|strip|firstline|escape}{tags%changelogtag} - diff -r 5751631246de -r 040484030491 templates/coal/tags.tmpl --- a/templates/coal/tags.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -{header} -{repo|escape}: tags - - - - - -
      - - -
      -

      {repo|escape}

      -

      tags

      - - - - - - - - -{entries%tagentry} -
      tagnode
      -
      -
      - -{footer} diff -r 5751631246de -r 040484030491 templates/monoblue/graph.tmpl --- a/templates/monoblue/graph.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ b/templates/monoblue/graph.tmpl Tue Nov 25 16:24:22 2008 -0600 @@ -59,7 +59,7 @@ var revlink = '
    • '; revlink += '_DESC'; - revlink += '_DATE ago, by _USER
    • '; + revlink += '_TAGS_DATE ago, by _USER'; graph.vertex = function(x, y, color, parity, cur) { @@ -79,6 +79,26 @@ item = item.replace(/_USER/, cur[4]); item = item.replace(/_DATE/, cur[5]); + var tagspan = ''; + if (cur[7].length || (cur[6][0] != 'default' || cur[6][1])) { + tagspan = ''; + if (cur[6][1]) { + tagspan += ''; + tagspan += cur[6][0] + ' '; + } else if (!cur[6][1] && cur[6][0] != 'default') { + tagspan += ''; + tagspan += cur[6][0] + ' '; + } + if (cur[7].length) { + for (var t in cur[7]) { + var tag = cur[7][t]; + tagspan += '' + tag + ' '; + } + } + tagspan += ''; + } + + item = item.replace(/_TAGS/, tagspan); return [bg, item]; } diff -r 5751631246de -r 040484030491 templates/monoblue/index.tmpl --- a/templates/monoblue/index.tmpl Tue Nov 18 16:02:14 2008 -0600 +++ b/templates/monoblue/index.tmpl Tue Nov 25 16:24:22 2008 -0600 @@ -1,26 +1,39 @@ #header# #repo|escape#: Mercurial repositories index - - - - - - - - - - - - - #entries%indexentry# -
      NameDescriptionContactLast change  
      - @@ -232,7 +223,7 @@

      test

      -

      changeset 0:0cd96de13884

      +

      changeset 0:0cd96de13884

      @@ -266,23 +257,19 @@
      - - - - - -
      linediff
      -
      1.1new file mode 100644 -
      1.2--- /dev/null -
      1.3+++ b/a -
      1.4@@ -0,0 +1,1 @@ -
      1.5+a -
      2.1new file mode 100644 -
      2.2--- /dev/null -
      2.3+++ b/b -
      2.4@@ -0,0 +1,1 @@ -
      2.5+b -
      +
      line diff
      + +
      1.1 new file mode 100644 + 1.2 --- /dev/null + 1.3 +++ b/a + 1.4 @@ -0,0 +1,1 @@ + 1.5 +a +
      2.1 new file mode 100644 + 2.2 --- /dev/null + 2.3 +++ b/b + 2.4 @@ -0,0 +1,1 @@ + 2.5 +b +
      @@ -365,19 +352,14 @@
      - - - - - -
      linediff
      +
      line diff
      -
      1.1new file mode 100755 -
      1.2--- /dev/null -
      1.3+++ b/a -
      1.4@@ -0,0 +1,1 @@ -
      1.5+a -
      +
      1.1 new file mode 100755 + 1.2 --- /dev/null + 1.3 +++ b/a + 1.4 @@ -0,0 +1,1 @@ + 1.5 +a +
      diff -r 5751631246de -r 040484030491 tests/test-hgweb-filelog.out --- a/tests/test-hgweb-filelog.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-hgweb-filelog.out Tue Nov 25 16:24:22 2008 -0600 @@ -401,7 +401,7 @@ mercurial diff -r 5751631246de -r 040484030491 tests/test-hgweb-removed.out --- a/tests/test-hgweb-removed.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-hgweb-removed.out Tue Nov 25 16:24:22 2008 -0600 @@ -39,7 +39,7 @@

      test

      -

      changeset 1:c78f6c5cbea9 tip

      +

      changeset 1:c78f6c5cbea9 tip

      @@ -73,17 +73,13 @@
      - - - - - -
      linediff
      -
      1.1--- a/a Thu Jan 01 00:00:00 1970 +0000 -
      1.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000 -
      1.3@@ -1,1 +0,0 @@ -
      1.4-a -
      +
      line diff
      + +
      1.1 --- a/a Thu Jan 01 00:00:00 1970 +0000 + 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 + 1.3 @@ -1,1 +0,0 @@ + 1.4 -a +
      @@ -166,18 +162,13 @@
      - - - - - -
      linediff
      +
      line diff
      -
      1.1--- a/a Thu Jan 01 00:00:00 1970 +0000 -
      1.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000 -
      1.3@@ -1,1 +0,0 @@ -
      1.4-a -
      +
      1.1 --- a/a Thu Jan 01 00:00:00 1970 +0000 + 1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 + 1.3 @@ -1,1 +0,0 @@ + 1.4 -a +
      diff -r 5751631246de -r 040484030491 tests/test-hgweb.out --- a/tests/test-hgweb.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-hgweb.out Tue Nov 25 16:24:22 2008 -0600 @@ -40,7 +40,7 @@ mercurial @@ -110,7 +110,7 @@ mercurial diff -r 5751631246de -r 040484030491 tests/test-highlight.out --- a/tests/test-highlight.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-highlight.out Tue Nov 25 16:24:22 2008 -0600 @@ -75,13 +75,9 @@
      - - - - - - -
      linesource
      1#!/usr/bin/env python
      2
      3__doc__ = """This does HTTP get requests given a host:port and path and returns
      4a subset of the headers plus the body of the result."""
      5
      6import httplib, sys
      7
      8try:
      9 import msvcrt, os
      10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
      11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
      12except ImportError:
      13 pass
      14
      15headers = [h.lower() for h in sys.argv[3:]]
      16conn = httplib.HTTPConnection(sys.argv[1])
      17conn.request("GET", sys.argv[2])
      18response = conn.getresponse()
      19print response.status, response.reason
      20for h in headers:
      21 if response.getheader(h, None) is not None:
      22 print "%s: %s" % (h, response.getheader(h))
      23print
      24sys.stdout.write(response.read())
      25
      26if 200 <= response.status <= 299:
      27 sys.exit(0)
      28sys.exit(1)
      +
      line source
      +
      1 #!/usr/bin/env python
      3 __doc__ = """This does HTTP get requests given a host:port and path and returns
      4 a subset of the headers plus the body of the result."""
      6 import httplib, sys
      8 try:
      9 import msvcrt, os
      10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
      11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
      12 except ImportError:
      13 pass
      15 headers = [h.lower() for h in sys.argv[3:]]
      16 conn = httplib.HTTPConnection(sys.argv[1])
      17 conn.request("GET", sys.argv[2])
      18 response = conn.getresponse()
      19 print response.status, response.reason
      20 for h in headers:
      21 if response.getheader(h, None) is not None:
      22 print "%s: %s" % (h, response.getheader(h))
      23 print
      24 sys.stdout.write(response.read())
      26 if 200 <= response.status <= 299:
      27 sys.exit(0)
      28 sys.exit(1)
      +
      @@ -165,13 +161,9 @@
      - - - - - - -
      linesource
      1h?bsch
      +
      line source
      +
      1 h?bsch
      +
      @@ -261,10 +253,9 @@ - - + - +
      revlinesource  line source
      test@0 1#!/usr/bin/env python
      test@0 2
      test@0 3__doc__ = """This does HTTP get requests given a host:port and path and returns
      test@0 4a subset of the headers plus the body of the result."""
      test@0 5
      test@0 6import httplib, sys
      test@0 7
      test@0 8try:
      test@0 9 import msvcrt, os
      test@0 10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
      test@0 11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
      test@0 12except ImportError:
      test@0 13 pass
      test@0 14
      test@0 15headers = [h.lower() for h in sys.argv[3:]]
      test@0 16conn = httplib.HTTPConnection(sys.argv[1])
      test@0 17conn.request("GET", sys.argv[2])
      test@0 18response = conn.getresponse()
      test@0 19print response.status, response.reason
      test@0 20for h in headers:
      test@0 21 if response.getheader(h, None) is not None:
      test@0 22 print "%s: %s" % (h, response.getheader(h))
      test@0 23print
      test@0 24sys.stdout.write(response.read())
      test@0 25
      test@0 26if 200 <= response.status <= 299:
      test@0 27 sys.exit(0)
      test@0 28sys.exit(1)
      test@0 1 #!/usr/bin/env python
      test@0 2
      test@0 3 __doc__ = """This does HTTP get requests given a host:port and path and returns
      test@0 4 a subset of the headers plus the body of the result."""
      test@0 5
      test@0 6 import httplib, sys
      test@0 7
      test@0 8 try:
      test@0 9 import msvcrt, os
      test@0 10 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
      test@0 11 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
      test@0 12 except ImportError:
      test@0 13 pass
      test@0 14
      test@0 15 headers = [h.lower() for h in sys.argv[3:]]
      test@0 16 conn = httplib.HTTPConnection(sys.argv[1])
      test@0 17 conn.request("GET", sys.argv[2])
      test@0 18 response = conn.getresponse()
      test@0 19 print response.status, response.reason
      test@0 20 for h in headers:
      test@0 21 if response.getheader(h, None) is not None:
      test@0 22 print "%s: %s" % (h, response.getheader(h))
      test@0 23 print
      test@0 24 sys.stdout.write(response.read())
      test@0 25
      test@0 26 if 200 <= response.status <= 299:
      test@0 27 sys.exit(0)
      test@0 28 sys.exit(1)
      diff -r 5751631246de -r 040484030491 tests/test-import --- a/tests/test-import Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-import Tue Nov 25 16:24:22 2008 -0600 @@ -285,3 +285,31 @@ rename to bar EOF cd .. + +echo '% test import with similarity (issue295)' +hg init sim +cd sim +echo 'this is a test' > a +hg ci -Ama +cat > ../rename.diff < dir/x +hg status . +hg status dir +cd dir +hg status . +cd .. + kill `cat hg.pid` diff -r 5751631246de -r 040484030491 tests/test-inotify.out --- a/tests/test-inotify.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-inotify.out Tue Nov 25 16:24:22 2008 -0600 @@ -27,3 +27,8 @@ C dir/x C dir/y C e +% path patterns +M dir/x +? hg.pid +M dir/x +M x diff -r 5751631246de -r 040484030491 tests/test-log.out --- a/tests/test-log.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-log.out Tue Nov 25 16:24:22 2008 -0600 @@ -5,7 +5,7 @@ summary: a % -f, directory -abort: can only follow copies/renames for explicit file names +abort: cannot follow nonexistent file: "dir" % -f, but no args changeset: 4:b30c444c7c84 tag: tip diff -r 5751631246de -r 040484030491 tests/test-mq-guards --- a/tests/test-mq-guards Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-mq-guards Tue Nov 25 16:24:22 2008 -0600 @@ -39,6 +39,9 @@ hg qguard hg qpop +echo % should fail +hg qpush a.patch + hg qguard a.patch echo % should push b.patch hg qpush diff -r 5751631246de -r 040484030491 tests/test-mq-guards.out --- a/tests/test-mq-guards.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-mq-guards.out Tue Nov 25 16:24:22 2008 -0600 @@ -10,6 +10,8 @@ % should print +a a.patch: +a Patch queue now empty +% should fail +cannot push 'a.patch' - guarded by ['+a'] a.patch: +a % should push b.patch applying b.patch diff -r 5751631246de -r 040484030491 tests/test-mq.out --- a/tests/test-mq.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-mq.out Tue Nov 25 16:24:22 2008 -0600 @@ -227,7 +227,7 @@ patch series already fully applied qpush fails % does nothing and succeeds -all patches are currently applied +qpush: test2.patch is already at the top qpush test2.patch succeeds % strip adding x diff -r 5751631246de -r 040484030491 tests/test-patchbomb --- a/tests/test-patchbomb Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-patchbomb Tue Nov 25 16:24:22 2008 -0600 @@ -4,6 +4,7 @@ { sed -e 's/\(Message-Id:.*@\).*/\1/' \ -e 's/\(In-Reply-To:.*@\).*/\1/' \ + -e 's/\(References:.*@\).*/\1/' \ -e 's/===.*/===/' } diff -r 5751631246de -r 040484030491 tests/test-patchbomb.out --- a/tests/test-patchbomb.out Tue Nov 18 16:02:14 2008 -0600 +++ b/tests/test-patchbomb.out Tue Nov 25 16:24:22 2008 -0600 @@ -54,6 +54,7 @@ X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab Message-Id: <8580ff50825a50c8f716.121@ In-Reply-To: