[PATCH STABLE] largefiles: don't break filesets

Dan Villiom Podlaski Christiansen dan at cabo.dk
Mon Feb 20 11:00:04 CST 2012


# HG changeset patch
# User Dan Villiom Podlaski Christiansen  <danchr at gmail.com>
# Date 1329757188 -3600
# Branch stable
# Node ID f346de4dff5799f94960ed7369cc8716b6984f61
# Parent  0e0060bf2f440d5cc33e5f36d99868a5380debd4
largefiles: don't break filesets

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -63,13 +63,21 @@ def reposetup(ui, repo):
                         return man1
                     def filectx(self, path, fileid=None, filelog=None):
                         try:
-                            result = super(lfiles_ctx, self).filectx(path,
-                                fileid, filelog)
+                            if filelog is not None:
+                                result = super(lfiles_ctx, self).filectx(
+                                    path, fileid, filelog)
+                            else:
+                                result = super(lfiles_ctx, self).filectx(
+                                    path, fileid)
                         except error.LookupError:
                             # Adding a null character will cause Mercurial to
                             # identify this as a binary file.
-                            result = super(lfiles_ctx, self).filectx(
-                                lfutil.standin(path), fileid, filelog)
+                            if filelog is not None:
+                                result = super(lfiles_ctx, self).filectx(
+                                    lfutil.standin(path), fileid, filelog)
+                            else:
+                                result = super(lfiles_ctx, self).filectx(
+                                    lfutil.standin(path), fileid)
                             olddata = result.data
                             result.data = lambda: olddata() + '\0'
                         return result
diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t
--- a/tests/test-largefiles.t
+++ b/tests/test-largefiles.t
@@ -994,4 +994,14 @@ related to largefiles in working directo
   C a/b/c/d/e.normal.txt
   C a/b/c/x/y.normal.txt
 
+verify that largefiles doesn't break filesets
+
+  $ hg log --rev . --exclude "set:binary()"
+  changeset:   0:41bd42f10efa
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     add files
+  
+
   $ cd ..


More information about the Mercurial-devel mailing list