# HG changeset patch # User Wagner Bruna # Date 1308692235 10800 # Node ID 5efc32b013ceda30ce4c280461ad328d1a65f662 # Parent 6c7283faa967741009f8223b04b1098ada8ec552# Parent a8de2eecd50a6fb49796050977db6fc44e33a587 merge with i18n diff -r a8de2eecd50a -r 5efc32b013ce Makefile --- a/Makefile Mon Jun 20 17:00:04 2011 -0300 +++ b/Makefile Tue Jun 21 18:37:15 2011 -0300 @@ -91,7 +91,7 @@ i18n/hg.pot: $(PYFILES) $(DOCFILES) $(PYTHON) i18n/hggettext mercurial/commands.py \ - hgext/*.py hgext/*/__init__.py mercurial/revset.py \ + hgext/*.py hgext/*/__init__.py mercurial/fileset.py mercurial/revset.py \ $(DOCFILES) > i18n/hg.pot # All strings marked for translation in Mercurial contain # ASCII characters only. But some files contain string diff -r a8de2eecd50a -r 5efc32b013ce contrib/check-code.py --- a/contrib/check-code.py Mon Jun 20 17:00:04 2011 -0300 +++ b/contrib/check-code.py Tue Jun 21 18:37:15 2011 -0300 @@ -178,6 +178,7 @@ (r'[\s\(](open|file)\([^)]*\)\.', "always assign an opened file to a variable, and close it afterwards"), (r'(?i)descendent', "the proper spelling is descendAnt"), + (r'\.debug\(\_', "don't mark debug messages for translation"), ], # warnings [ diff -r a8de2eecd50a -r 5efc32b013ce hgext/relink.py --- a/hgext/relink.py Mon Jun 20 17:00:04 2011 -0300 +++ b/hgext/relink.py Tue Jun 21 18:37:15 2011 -0300 @@ -117,7 +117,7 @@ tgt = os.path.join(dst, fn) ts = linkfilter(srcpath, tgt, st) if not ts: - ui.debug(_('not linkable: %s\n') % fn) + ui.debug('not linkable: %s\n' % fn) continue targets.append((fn, ts.st_size)) ui.progress(_('pruning'), pos, fn, _('files'), total) @@ -159,7 +159,7 @@ sfp.close() dfp.close() if sin: - ui.debug(_('not linkable: %s\n') % f) + ui.debug('not linkable: %s\n' % f) continue try: relinkfile(source, tgt) diff -r a8de2eecd50a -r 5efc32b013ce mercurial/commands.py --- a/mercurial/commands.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/commands.py Tue Jun 21 18:37:15 2011 -0300 @@ -4552,7 +4552,7 @@ """ for f in scmutil.rcpath(): - ui.debug(_('read config from: %s\n') % f) + ui.debug('read config from: %s\n' % f) untrusted = bool(opts.get('untrusted')) if values: sections = [v for v in values if '.' not in v] diff -r a8de2eecd50a -r 5efc32b013ce mercurial/commandserver.py --- a/mercurial/commandserver.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/commandserver.py Tue Jun 21 18:37:15 2011 -0300 @@ -155,6 +155,9 @@ raise util.Abort(_('unknown mode %s') % mode) def _read(self, size): + if not size: + return '' + data = self.client.read(size) # is the other end closed? @@ -168,7 +171,10 @@ and writes the return code to the result channel """ length = struct.unpack('>I', self._read(4))[0] - args = self._read(length).split('\0') + if not length: + args = [] + else: + args = self._read(length).split('\0') # copy the ui so changes to it don't persist between requests req = dispatch.request(args, self.ui.copy(), self.repo, self.cin, diff -r a8de2eecd50a -r 5efc32b013ce mercurial/config.py --- a/mercurial/config.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/config.py Tue Jun 21 18:37:15 2011 -0300 @@ -27,6 +27,9 @@ def update(self, src): for k in src: self[k] = src[k] + def clear(self): + dict.clear(self) + self._list = [] def items(self): return [(k, self[k]) for k in self._list] def __delitem__(self, key): diff -r a8de2eecd50a -r 5efc32b013ce mercurial/dispatch.py --- a/mercurial/dispatch.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/dispatch.py Tue Jun 21 18:37:15 2011 -0300 @@ -267,8 +267,8 @@ elif int(m.groups()[0]) <= len(args): return m.group() else: - ui.debug(_("No argument found for substitution " - "of %i variable in alias '%s' definition.") + ui.debug("No argument found for substitution " + "of %i variable in alias '%s' definition." % (int(m.groups()[0]), self.name)) return '' cmd = re.sub(r'\$(\d+|\$)', _checkvar, self.definition[1:]) diff -r a8de2eecd50a -r 5efc32b013ce mercurial/fileset.py --- a/mercurial/fileset.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/fileset.py Tue Jun 21 18:37:15 2011 -0300 @@ -228,7 +228,7 @@ return [f for f in mctx.subset if f in ms and ms[f] == 'u'] def hgignore(mctx, x): - """``resolved()`` + """``hgignore()`` File that matches the active .hgignore pattern. """ getargs(x, 0, 0, _("hgignore takes no arguments")) @@ -305,7 +305,7 @@ elif expr[0].isdigit or expr[0] == '.': a = _sizetoint(expr) b = _sizetomax(expr) - m = lambda x: x >=a and x <= b + m = lambda x: x >= a and x <= b else: raise error.ParseError(_("couldn't parse size"), expr) @@ -402,7 +402,7 @@ def getfileset(ctx, expr): tree, pos = parse(expr) if (pos != len(expr)): - raise error.ParseError("invalid token", pos) + raise error.ParseError(_("invalid token"), pos) # do we need status info? if _intree(['modified', 'added', 'removed', 'deleted', diff -r a8de2eecd50a -r 5efc32b013ce mercurial/help/config.txt --- a/mercurial/help/config.txt Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/help/config.txt Tue Jun 21 18:37:15 2011 -0300 @@ -913,6 +913,11 @@ file exists, it is replaced. Default: None, data is printed on stderr +``revsetalias`` +""""""""""""""" + +Alias definitions for revsets. See :hg:`help revsets` for details. + ``server`` """""""""" diff -r a8de2eecd50a -r 5efc32b013ce mercurial/help/revsets.txt --- a/mercurial/help/revsets.txt Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/help/revsets.txt Tue Jun 21 18:37:15 2011 -0300 @@ -42,7 +42,7 @@ ``x - y`` Changesets in x but not in y. - + ``x^n`` The nth parent of x, n == 0, 1, or 2. For n == 0, x; for n == 1, the first parent of each changeset in x; @@ -66,8 +66,9 @@ = -in the ``revsetalias`` section of ``.hgrc``. Arguments of the form `$1`, `$2`, -etc. are substituted from the alias into the definition. +in the ``revsetalias`` section of a Mercurial configuration file. Arguments +of the form `$1`, `$2`, etc. are substituted from the alias into the +definition. For example, diff -r a8de2eecd50a -r 5efc32b013ce mercurial/parser.py --- a/mercurial/parser.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/parser.py Tue Jun 21 18:37:15 2011 -0300 @@ -16,6 +16,7 @@ # __call__(program) parses program into a labelled tree import error +from i18n import _ class parser(object): def __init__(self, tokenizer, elements, methods=None): @@ -34,7 +35,7 @@ def _match(self, m, pos): 'make sure the tokenizer matches an end condition' if self.current[0] != m: - raise error.ParseError("unexpected token: %s" % self.current[0], + raise error.ParseError(_("unexpected token: %s") % self.current[0], self.current[2]) self._advance() def _parse(self, bind=0): @@ -42,7 +43,7 @@ # handle prefix rules on current token prefix = self._elements[token][1] if not prefix: - raise error.ParseError("not a prefix: %s" % token, pos) + raise error.ParseError(_("not a prefix: %s") % token, pos) if len(prefix) == 1: expr = (prefix[0], value) else: @@ -64,7 +65,7 @@ else: # handle infix rules if len(e) < 3 or not e[2]: - raise error.ParseError("not an infix: %s" % token, pos) + raise error.ParseError(_("not an infix: %s") % token, pos) infix = e[2] if len(infix) == 3 and infix[2] == self.current[0]: self._match(infix[2], pos) diff -r a8de2eecd50a -r 5efc32b013ce mercurial/patch.py --- a/mercurial/patch.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/patch.py Tue Jun 21 18:37:15 2011 -0300 @@ -1378,7 +1378,7 @@ cwd = repo.getcwd() if cwd: cfiles = [util.pathto(repo.root, cwd, f) - for f in cfile] + for f in cfiles] scmutil.addremove(repo, cfiles, similarity=similarity) code = fp.close() if code: diff -r a8de2eecd50a -r 5efc32b013ce mercurial/revset.py --- a/mercurial/revset.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/revset.py Tue Jun 21 18:37:15 2011 -0300 @@ -979,7 +979,7 @@ value = value.replace(arg, repr(arg)) self.replacement, pos = parse(value) if pos != len(value): - raise error.ParseError('invalid token', pos) + raise error.ParseError(_('invalid token'), pos) else: self.replacement = value @@ -997,7 +997,8 @@ (len(self.args) == 1 and tree[2][0] == 'list') or (len(self.args) > 1 and (tree[2][0] != 'list' or len(tree[2]) - 1 != len(self.args)))): - raise error.ParseError('invalid amount of arguments', len(tree) - 2) + raise error.ParseError(_('invalid amount of arguments'), + len(tree) - 2) return True def replace(self, tree): @@ -1033,7 +1034,7 @@ raise error.ParseError(_("empty query")) tree, pos = parse(spec) if (pos != len(spec)): - raise error.ParseError("invalid token", pos) + raise error.ParseError(_("invalid token"), pos) tree = findaliases(ui, tree) weight, tree = optimize(tree, True) def mfunc(repo, subset): diff -r a8de2eecd50a -r 5efc32b013ce mercurial/treediscovery.py --- a/mercurial/treediscovery.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/treediscovery.py Tue Jun 21 18:37:15 2011 -0300 @@ -49,7 +49,6 @@ if not unknown: return list(base), [], list(heads) - heads = unknown req = set(unknown) reqcnt = 0 diff -r a8de2eecd50a -r 5efc32b013ce mercurial/ui.py --- a/mercurial/ui.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/ui.py Tue Jun 21 18:37:15 2011 -0300 @@ -159,8 +159,8 @@ if self.debugflag and not untrusted and self._reportuntrusted: uvalue = self._ucfg.get(section, name) if uvalue is not None and uvalue != value: - self.debug(_("ignoring untrusted configuration option " - "%s.%s = %s\n") % (section, name, uvalue)) + self.debug("ignoring untrusted configuration option " + "%s.%s = %s\n" % (section, name, uvalue)) return value def configpath(self, section, name, default=None, untrusted=False): @@ -330,8 +330,8 @@ if self.debugflag and not untrusted and self._reportuntrusted: for k, v in self._ucfg.items(section): if self._tcfg.get(section, k) != v: - self.debug(_("ignoring untrusted configuration option " - "%s.%s = %s\n") % (section, k, v)) + self.debug("ignoring untrusted configuration option " + "%s.%s = %s\n" % (section, k, v)) return items def walkconfig(self, untrusted=False): diff -r a8de2eecd50a -r 5efc32b013ce mercurial/util.py --- a/mercurial/util.py Mon Jun 20 17:00:04 2011 -0300 +++ b/mercurial/util.py Tue Jun 21 18:37:15 2011 -0300 @@ -1359,6 +1359,8 @@ >>> url(r'c:\foo\bar') + >>> url(r'\\blah\blah\blah') + Authentication credentials: @@ -1387,8 +1389,8 @@ self._hostport = '' self._origpath = path - # special case for Windows drive letters - if hasdriveletter(path): + # special case for Windows drive letters and UNC paths + if hasdriveletter(path) or path.startswith(r'\\'): self.path = path return diff -r a8de2eecd50a -r 5efc32b013ce tests/test-treediscovery.t --- a/tests/test-treediscovery.t Mon Jun 20 17:00:04 2011 -0300 +++ b/tests/test-treediscovery.t Tue Jun 21 18:37:15 2011 -0300 @@ -319,5 +319,180 @@ 11 a19bfa7e7328: r11 both $ cd .. +Both have new stuff in new named branches: + + $ stop + $ hg clone main repo1a --rev name1 -q + $ hg clone repo1a repo1b -q + $ hg clone main repo2a --rev name2 -q + $ hg clone repo2a repo2b -q + $ start repo1a + + $ cd repo2a + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 6 a7892891da29: r2 name1 + 7 2c8d5d5ec612: r3 name1 + 8 e71dbbc70e03: r4 name1 + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 2 70314b29987d: r5 name2 + 3 6c6f5d5f3c11: r6 name2 + 4 b6b4d315a2ac: r7 name2 + 5 d8f638ac69e9: r8 name2 + $ hg push $remote --new-branch + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 4 changesets with 8 changes to 2 files (+1 heads) + $ hg pull $remote + pulling from http://localhost:$HGPORT/ + searching for changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 6 changes to 2 files (+1 heads) + (run 'hg heads' to see heads) + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ cd .. + + $ stop ; start repo1b + $ cd repo2b + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 6 a7892891da29: r2 name1 + 7 2c8d5d5ec612: r3 name1 + 8 e71dbbc70e03: r4 name1 + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 2 70314b29987d: r5 name2 + 3 6c6f5d5f3c11: r6 name2 + 4 b6b4d315a2ac: r7 name2 + 5 d8f638ac69e9: r8 name2 + $ hg pull $remote + pulling from http://localhost:$HGPORT/ + searching for changes + adding changesets + adding manifests + adding file changes + added 3 changesets with 6 changes to 2 files (+1 heads) + (run 'hg heads' to see heads) + $ hg push $remote --new-branch + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 4 changesets with 8 changes to 2 files (+1 heads) + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ cd .. + +Both have new stuff in existing named branches: + + $ stop + $ rm -r repo1a repo1b repo2a repo2b + $ hg clone main repo1a --rev 3 --rev 8 -q + $ hg clone repo1a repo1b -q + $ hg clone main repo2a --rev 4 --rev 7 -q + $ hg clone repo2a repo2b -q + $ start repo1a + + $ cd repo2a + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 8 d8f638ac69e9: r8 name2 + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 4 e71dbbc70e03: r4 name1 + $ hg push $remote --new-branch + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 2 changes to 2 files + $ hg pull $remote + pulling from http://localhost:$HGPORT/ + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 2 changes to 2 files + (run 'hg update' to get a working copy) + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ cd .. + + $ stop ; start repo1b + $ cd repo2b + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 8 d8f638ac69e9: r8 name2 + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + 4 e71dbbc70e03: r4 name1 + $ hg pull $remote + pulling from http://localhost:$HGPORT/ + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 2 changes to 2 files + (run 'hg update' to get a working copy) + $ hg push $remote --new-branch + pushing to http://localhost:$HGPORT/ + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 2 changes to 2 files + $ hg incoming $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ hg outgoing $remote + comparing with http://localhost:$HGPORT/ + searching for changes + no changes found + [1] + $ cd .. + $ stop