changeset 15603:36d7a0c7505f

merge with stable
author Matt Mackall <mpm@selenic.com>
date Thu, 01 Dec 2011 15:57:10 -0600
parents 2555f441a32f (current diff) 2f2ca019569f (diff)
children 2ad5b8937d0d a2edccdfb86a
files mercurial/cmdutil.py tests/test-alias.t tests/test-largefiles.t
diffstat 9 files changed, 70 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsigs	Thu Dec 01 01:42:03 2011 -0600
+++ b/.hgsigs	Thu Dec 01 15:57:10 2011 -0600
@@ -45,3 +45,4 @@
 351a9292e430e35766c552066ed3e87c557b803b 0 iD8DBQBOh3zUywK+sNU5EO8RApFMAKCD3Y/u3avDFndznwqfG5UeTHMlvACfUivPIVQZyDZnhZMq0UhC6zhCEQg=
 384082750f2c51dc917d85a7145748330fa6ef4d 0 iD8DBQBOmd+OywK+sNU5EO8RAgDgAJ9V/X+G7VLwhTpHrZNiOHabzSyzYQCdE2kKfIevJUYB9QLAWCWP6DPwrwI=
 41453d55b481ddfcc1dacb445179649e24ca861d 0 iD8DBQBOsFhpywK+sNU5EO8RAqM6AKCyfxUae3/zLuiLdQz+JR78690eMACfQ6JTBQib4AbE+rUDdkeFYg9K/+4=
+195dbd1cef0c2f9f8bcf4ea303238105f716bda3 0 iD8DBQBO1/fWywK+sNU5EO8RAmoPAKCR5lpv1D6JLURHD8KVLSV4GRVEBgCgnd0Sy78ligNfqAMafmACRDvj7vo=
--- a/.hgtags	Thu Dec 01 01:42:03 2011 -0600
+++ b/.hgtags	Thu Dec 01 15:57:10 2011 -0600
@@ -57,3 +57,4 @@
 351a9292e430e35766c552066ed3e87c557b803b 1.9.3
 384082750f2c51dc917d85a7145748330fa6ef4d 2.0-rc
 41453d55b481ddfcc1dacb445179649e24ca861d 2.0
+195dbd1cef0c2f9f8bcf4ea303238105f716bda3 2.0.1
--- a/hgext/convert/subversion.py	Thu Dec 01 01:42:03 2011 -0600
+++ b/hgext/convert/subversion.py	Thu Dec 01 15:57:10 2011 -0600
@@ -50,10 +50,21 @@
         mod = '/' + parts[1]
     return parts[0][4:], mod, int(revnum)
 
+def quote(s):
+    # As of svn 1.7, many svn calls expect "canonical" paths. In
+    # theory, we should call svn.core.*canonicalize() on all paths
+    # before passing them to the API.  Instead, we assume the base url
+    # is canonical and copy the behaviour of svn URL encoding function
+    # so we can extend it safely with new components. The "safe"
+    # characters were taken from the "svn_uri__char_validity" table in
+    # libsvn_subr/path.c.
+    return urllib.quote(s, "!$&'()*+,-./:=@_~")
+
 def geturl(path):
     try:
         return svn.client.url_from_path(svn.core.svn_path_canonicalize(path))
     except SubversionException:
+        # svn.client.url_from_path() fails with local repositories
         pass
     if os.path.isdir(path):
         path = os.path.normpath(os.path.abspath(path))
@@ -62,8 +73,8 @@
         # Module URL is later compared with the repository URL returned
         # by svn API, which is UTF-8.
         path = encoding.tolocal(path)
-        return 'file://%s' % urllib.quote(path)
-    return path
+        path = 'file://%s' % quote(path)
+    return svn.core.svn_path_canonicalize(path)
 
 def optrev(number):
     optrev = svn.core.svn_opt_revision_t()
@@ -306,7 +317,7 @@
 
     def exists(self, path, optrev):
         try:
-            svn.client.ls(self.url.rstrip('/') + '/' + urllib.quote(path),
+            svn.client.ls(self.url.rstrip('/') + '/' + quote(path),
                                  optrev, False, self.ctx)
             return True
         except SubversionException:
@@ -358,7 +369,7 @@
         # Check if branches bring a few more heads to the list
         if branches:
             rpath = self.url.strip('/')
-            branchnames = svn.client.ls(rpath + '/' + urllib.quote(branches),
+            branchnames = svn.client.ls(rpath + '/' + quote(branches),
                                         rev, False, self.ctx)
             for branch in branchnames.keys():
                 module = '%s/%s/%s' % (oldmodule, branches, branch)
@@ -394,7 +405,7 @@
         else:
             # Perform a full checkout on roots
             uuid, module, revnum = revsplit(rev)
-            entries = svn.client.ls(self.baseurl + urllib.quote(module),
+            entries = svn.client.ls(self.baseurl + quote(module),
                                     optrev(revnum), True, self.ctx)
             files = [n for n, e in entries.iteritems()
                      if e.kind == svn.core.svn_node_file]
@@ -595,7 +606,7 @@
         """Reparent the svn transport and return the previous parent."""
         if self.prevmodule == module:
             return module
-        svnurl = self.baseurl + urllib.quote(module)
+        svnurl = self.baseurl + quote(module)
         prevmodule = self.prevmodule
         if prevmodule is None:
             prevmodule = ''
@@ -866,7 +877,7 @@
         """Enumerate all files in path at revnum, recursively."""
         path = path.strip('/')
         pool = Pool()
-        rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
+        rpath = '/'.join([self.baseurl, quote(path)]).strip('/')
         entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool)
         if path:
             path += '/'
--- a/hgext/convert/transport.py	Thu Dec 01 01:42:03 2011 -0600
+++ b/hgext/convert/transport.py	Thu Dec 01 15:57:10 2011 -0600
@@ -86,7 +86,7 @@
             self.client.config = svn_config
             try:
                 self.ra = svn.client.open_ra_session(
-                    self.svn_url.encode('utf8'),
+                    self.svn_url,
                     self.client, self.pool)
             except SubversionException, (inst, num):
                 if num in (svn.core.SVN_ERR_RA_ILLEGAL_URL,
--- a/hgext/largefiles/overrides.py	Thu Dec 01 01:42:03 2011 -0600
+++ b/hgext/largefiles/overrides.py	Thu Dec 01 15:57:10 2011 -0600
@@ -373,7 +373,8 @@
                 origcopyfile = util.copyfile
                 copiedfiles = []
                 def override_copyfile(src, dest):
-                    if lfutil.shortname in src and lfutil.shortname in dest:
+                    if (lfutil.shortname in src and
+                        dest.startswith(repo.wjoin(lfutil.shortname))):
                         destlfile = dest.replace(lfutil.shortname, '')
                         if not opts['force'] and os.path.exists(destlfile):
                             raise IOError('',
@@ -388,18 +389,19 @@
 
             lfdirstate = lfutil.openlfdirstate(ui, repo)
             for (src, dest) in copiedfiles:
-                if lfutil.shortname in src and lfutil.shortname in dest:
-                    srclfile = src.replace(lfutil.shortname, '')
-                    destlfile = dest.replace(lfutil.shortname, '')
+                if (lfutil.shortname in src and
+                    dest.startswith(repo.wjoin(lfutil.shortname))):
+                    srclfile = src.replace(repo.wjoin(lfutil.standin('')), '')
+                    destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '')
                     destlfiledir = os.path.dirname(destlfile) or '.'
                     if not os.path.isdir(destlfiledir):
                         os.makedirs(destlfiledir)
                     if rename:
-                        os.rename(srclfile, destlfile)
-                        lfdirstate.remove(repo.wjoin(srclfile))
+                        os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
+                        lfdirstate.remove(srclfile)
                     else:
                         util.copyfile(srclfile, destlfile)
-                    lfdirstate.add(repo.wjoin(destlfile))
+                    lfdirstate.add(destlfile)
             lfdirstate.write()
         except util.Abort, e:
             if str(e) != 'no files to copy':
--- a/mercurial/bundlerepo.py	Thu Dec 01 01:42:03 2011 -0600
+++ b/mercurial/bundlerepo.py	Thu Dec 01 15:57:10 2011 -0600
@@ -266,6 +266,10 @@
     def getcwd(self):
         return os.getcwd() # always outside the repo
 
+    def _writebranchcache(self, branches, tip, tiprev):
+        # don't overwrite the disk cache with bundle-augmented data
+        pass
+
 def instance(ui, path, create):
     if create:
         raise util.Abort(_('cannot create new bundle repository'))
--- a/mercurial/cmdutil.py	Thu Dec 01 01:42:03 2011 -0600
+++ b/mercurial/cmdutil.py	Thu Dec 01 15:57:10 2011 -0600
@@ -23,7 +23,14 @@
     """
     choice = {}
     debugchoice = {}
-    for e in table.keys():
+
+    if cmd in table:
+        # short-circuit exact matches, "log" alias beats "^log|history"
+        keys = [cmd]
+    else:
+        keys = table.keys()
+
+    for e in keys:
         aliases = parsealiases(e)
         found = None
         if cmd in aliases:
--- a/tests/test-alias.t	Thu Dec 01 01:42:03 2011 -0600
+++ b/tests/test-alias.t	Thu Dec 01 15:57:10 2011 -0600
@@ -397,3 +397,11 @@
   use "hg help" for the full list of commands or "hg -v" for details
   [255]
 
+This should show id:
+
+  $ hg --config alias.log='id' log
+  000000000000 tip
+
+This shouldn't:
+
+  $ hg --config alias.log='id' history
--- a/tests/test-largefiles.t	Thu Dec 01 01:42:03 2011 -0600
+++ b/tests/test-largefiles.t	Thu Dec 01 15:57:10 2011 -0600
@@ -53,10 +53,13 @@
   $ ls
   sub
 
-Copy both largefiles and normal files.
+Copy both largefiles and normal files (testing that status output is correct).
 
   $ hg cp sub/normal2 normal1
   $ hg cp sub/large2 large1
+  $ hg st
+  A large1
+  A normal1
   $ hg commit -m "copy files"
   $ cat normal1
   normal22
@@ -695,7 +698,22 @@
   large6-modified
   $ cat sub2/large7
   large7
-  $ cd ..
+
+Test that renaming a largefile results in correct output for status
+
+  $ hg rename sub/large4 large4-renamed
+  $ hg st
+  A large4-renamed
+  R sub/large4
+  $ hg commit -m "test rename output"
+  $ cat large4-renamed
+  large4-modified
+  $ cd sub2
+  $ hg rename large6 large6-renamed
+  $ hg st
+  A sub2/large6-renamed
+  R sub2/large6
+  $ cd ../..
 
 vanilla clients not locked out from largefiles servers on vanilla repos
   $ mkdir r1