--- a/hgext/bookmarks.py Sat Aug 21 00:33:13 2010 +0200
+++ b/hgext/bookmarks.py Sat Aug 21 11:21:49 2010 +0200
@@ -442,9 +442,12 @@
if b in repo._bookmarks:
ui.status(_("exporting bookmark %s\n") % b)
new = repo[b].hex()
- else:
+ elif b in rb:
ui.status(_("deleting remote bookmark %s\n") % b)
new = '' # delete
+ else:
+ ui.warn(_('bookmark %s does not exist on the local or remote repository!\n') % b)
+ return 2
old = rb.get(b, '')
r = other.pushkey('bookmarks', b, old, new)
if not r:
--- a/hgext/convert/cvs.py Sat Aug 21 00:33:13 2010 +0200
+++ b/hgext/convert/cvs.py Sat Aug 21 11:21:49 2010 +0200
@@ -5,9 +5,9 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-import os, locale, re, socket, errno
+import os, re, socket, errno
from cStringIO import StringIO
-from mercurial import util
+from mercurial import encoding, util
from mercurial.i18n import _
from common import NoRepo, commit, converter_source, checktool
@@ -30,7 +30,7 @@
self.socket = None
self.cvsroot = open(os.path.join(cvs, "Root")).read()[:-1]
self.cvsrepo = open(os.path.join(cvs, "Repository")).read()[:-1]
- self.encoding = locale.getpreferredencoding()
+ self.encoding = encoding.encoding
self._connect()
--- a/hgext/convert/gnuarch.py Sat Aug 21 00:33:13 2010 +0200
+++ b/hgext/convert/gnuarch.py Sat Aug 21 11:21:49 2010 +0200
@@ -8,8 +8,8 @@
from common import NoRepo, commandline, commit, converter_source
from mercurial.i18n import _
-from mercurial import util
-import os, shutil, tempfile, stat, locale
+from mercurial import encoding, util
+import os, shutil, tempfile, stat
from email.Parser import Parser
class gnuarch_source(converter_source, commandline):
@@ -55,7 +55,7 @@
self.parents = {}
self.tags = {}
self.catlogparser = Parser()
- self.locale = locale.getpreferredencoding()
+ self.encoding = encoding.encoding
self.archives = []
def before(self):
--- a/i18n/pt_BR.po Sat Aug 21 00:33:13 2010 +0200
+++ b/i18n/pt_BR.po Sat Aug 21 11:21:49 2010 +0200
@@ -515,6 +515,10 @@
msgid "deleting remote bookmark %s\n"
msgstr "apagando marcador remoto %s\n"
+#, python-format
+msgid "bookmark %s does not exist on the local or remote repository!\n"
+msgstr "o marcador %s não existe nem no repositório local nem no remoto!\n"
+
msgid "searching for changes\n"
msgstr "procurando por mudanças\n"
@@ -11852,6 +11856,30 @@
" Veja 'Head, branch'."
msgid ""
+"Branch, inactive\n"
+" If a named branch has no topological heads, it is considered to be\n"
+" inactive. As an example, a feature branch becomes inactive when it\n"
+" is merged into the default branch. The :hg:`branches` command\n"
+" shows inactive branches by default, though they can be hidden with\n"
+" :hg:`branches --active`."
+msgstr ""
+"Branch, inactive\n"
+" Ramo inativo. Um ramo nomeado é considerado inativo se ele não tiver\n"
+" cabeças topológicas. Por exemplo, um \"feature branch\" (ramo de\n"
+" implementação) se torna inativo quando for mesclado com o ramo default.\n"
+" O comando :hg:`branches` mostra ramos inativos por padrão, mas eles\n"
+" podem ser ocultados usando :hg:`branches --active`."
+
+msgid ""
+" NOTE: this concept is deprecated because it is too implicit.\n"
+" Branches should now be explicitly closed using :hg:`commit\n"
+" --close-branch` when they are no longer needed."
+msgstr ""
+" NOTA: este conceito foi tornado obsoleto por ser demasiado implícito.\n"
+" Atualmente, quando não forem mais necessários, ramos nomeados devem\n"
+" ser fechados explicitamente usando :hg:`commit --close-branch`."
+
+msgid ""
"Branch, named\n"
" A collection of changesets which have the same branch name. By\n"
" default, children of a changeset in a named branch belong to the\n"
@@ -13561,6 +13589,13 @@
msgid ":shortdate: Date. Returns a date like \"2006-09-18\"."
msgstr ":shortdate: Data. Devolve uma data como \"2006-09-18\"."
+msgid ""
+":stringify: Any type. Turns the value into text by converting values into\n"
+" text and concatenating them."
+msgstr ""
+":stringify: Qualquer tipo. Transforma o valor em texto convertendo cada\n"
+" parte em texto e concatenando os resultados."
+
msgid ":strip: Any text. Strips all leading and trailing whitespace."
msgstr ""
":strip: Qualquer texto. Remove todos os espaços em branco no\n"
--- a/mercurial/win32.py Sat Aug 21 00:33:13 2010 +0200
+++ b/mercurial/win32.py Sat Aug 21 11:21:49 2010 +0200
@@ -23,15 +23,6 @@
def os_link(src, dst):
try:
win32file.CreateHardLink(dst, src)
- # CreateHardLink sometimes succeeds on mapped drives but
- # following nlinks() returns 1. Check it now and bail out.
- if nlinks(src) < 2:
- try:
- win32file.DeleteFile(dst)
- except:
- pass
- # Fake hardlinking error
- raise OSError(errno.EINVAL, 'Hardlinking not supported')
except pywintypes.error:
raise OSError(errno.EINVAL, 'target implements hardlinks improperly')
except NotImplementedError: # Another fake error win Win98
@@ -43,41 +34,41 @@
fh = win32file.CreateFile(pathname,
win32file.GENERIC_READ, win32file.FILE_SHARE_READ,
None, win32file.OPEN_EXISTING, 0, None)
- try:
- return win32file.GetFileInformationByHandle(fh)
- finally:
- fh.Close()
except pywintypes.error:
- return None
+ raise OSError(errno.ENOENT, 'The system cannot find the file specified')
+ try:
+ return win32file.GetFileInformationByHandle(fh)
+ finally:
+ fh.Close()
def nlinks(pathname):
"""Return number of hardlinks for the given file."""
- res = _getfileinfo(pathname)
- if res is not None:
- return res[7]
- else:
- return os.lstat(pathname).st_nlink
+ links = _getfileinfo(pathname)[7]
+ if links < 2:
+ # Known to be wrong for most network drives
+ dirname = os.path.dirname(pathname)
+ if not dirname:
+ dirname = '.'
+ dt = win32file.GetDriveType(dirname + '\\')
+ if dt == 4 or dt == 1:
+ # Fake hardlink to force COW for network drives
+ links = 2
+ return links
def samefile(fpath1, fpath2):
"""Returns whether fpath1 and fpath2 refer to the same file. This is only
guaranteed to work for files, not directories."""
res1 = _getfileinfo(fpath1)
res2 = _getfileinfo(fpath2)
- if res1 is not None and res2 is not None:
- # Index 4 is the volume serial number, and 8 and 9 contain the file ID
- return res1[4] == res2[4] and res1[8] == res2[8] and res1[9] == res2[9]
- else:
- return False
+ # Index 4 is the volume serial number, and 8 and 9 contain the file ID
+ return res1[4] == res2[4] and res1[8] == res2[8] and res1[9] == res2[9]
def samedevice(fpath1, fpath2):
"""Returns whether fpath1 and fpath2 are on the same device. This is only
guaranteed to work for files, not directories."""
res1 = _getfileinfo(fpath1)
res2 = _getfileinfo(fpath2)
- if res1 is not None and res2 is not None:
- return res1[4] == res2[4]
- else:
- return False
+ return res1[4] == res2[4]
def testpid(pid):
'''return True if pid is still running or unable to