largefiles: fix 'hg status' abort after merge stable
authorMartin Geisler <mg@aragost.com>
Fri, 09 Dec 2011 17:34:58 +0100
branchstable
changeset 15629 5b66e55c0d93
parent 15616 05e522d3f186
child 15630 e6868bd17f24
child 15633 dc5d1394ecd1
largefiles: fix 'hg status' abort after merge If a largefile is introduced on the branch that is merged into the working copy, then 'hg status' would abort with an error like: $ hg status abort: .hglf/foo@33fdd332ec64: not found in manifest! The problem was that the largefiles status code only looked in the first parent for the largefile. Largefiles are now always reported as modified if they don't exist in the first parent -- this matches the behavior of localrepo.status for normal files.
hgext/largefiles/reposetup.py
tests/test-largefiles.t
--- a/hgext/largefiles/reposetup.py	Tue Dec 06 15:50:28 2011 +0100
+++ b/hgext/largefiles/reposetup.py	Fri Dec 09 17:34:58 2011 +0100
@@ -156,7 +156,11 @@
                                 ignored, clean) = s
                         if parentworking:
                             for lfile in unsure:
-                                if ctx1[lfutil.standin(lfile)].data().strip() \
+                                standin = lfutil.standin(lfile)
+                                if standin not in ctx1:
+                                    # from second parent
+                                    modified.append(lfile)
+                                elif ctx1[standin].data().strip() \
                                         != lfutil.hashfile(self.wjoin(lfile)):
                                     modified.append(lfile)
                                 else:
--- a/tests/test-largefiles.t	Tue Dec 06 15:50:28 2011 +0100
+++ b/tests/test-largefiles.t	Fri Dec 09 17:34:58 2011 +0100
@@ -645,6 +645,23 @@
   $ cat sub2/large7
   large7
 
+Test status after merging with a branch that introduces a new largefile:
+
+  $ echo large > large
+  $ hg add --large large
+  $ hg commit -m 'add largefile'
+  $ hg update -q ".^"
+  $ echo change >> normal3
+  $ hg commit -m 'some change'
+  created new head
+  $ hg merge
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  getting changed largefiles
+  1 largefiles updated, 0 removed
+  $ hg status
+  M large
+
 Test that a normal file and a largefile with the same name and path cannot
 coexist.