##// END OF EJS Templates
largefiles: defer lfdirstate.drop() until after commit (issue3364)...
Matt Harbison -
r17230:fc4c1556 stable
parent child Browse files
Show More
@@ -338,15 +338,18 b' def reposetup(ui, repo):'
338 lfutil.updatestandin(self,
338 lfutil.updatestandin(self,
339 lfutil.standin(lfile))
339 lfutil.standin(lfile))
340 lfdirstate.normal(lfile)
340 lfdirstate.normal(lfile)
341 for lfile in lfdirstate:
342 if lfile in modifiedfiles:
343 if (not os.path.exists(repo.wjoin(
344 lfutil.standin(lfile)))) or \
345 (not os.path.exists(repo.wjoin(lfile))):
346 lfdirstate.drop(lfile)
347
341
348 result = orig(text=text, user=user, date=date, match=match,
342 result = orig(text=text, user=user, date=date, match=match,
349 force=force, editor=editor, extra=extra)
343 force=force, editor=editor, extra=extra)
344
345 if result is not None:
346 for lfile in lfdirstate:
347 if lfile in modifiedfiles:
348 if (not os.path.exists(repo.wjoin(
349 lfutil.standin(lfile)))) or \
350 (not os.path.exists(repo.wjoin(lfile))):
351 lfdirstate.drop(lfile)
352
350 # This needs to be after commit; otherwise precommit hooks
353 # This needs to be after commit; otherwise precommit hooks
351 # get the wrong status
354 # get the wrong status
352 lfdirstate.write()
355 lfdirstate.write()
@@ -389,6 +389,59 b' Test addremove with -R'
389 adding normaladdremove
389 adding normaladdremove
390 $ cd a
390 $ cd a
391
391
392 Test 3364
393 $ hg clone . ../addrm
394 updating to branch default
395 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 getting changed largefiles
397 3 largefiles updated, 0 removed
398 $ cd ../addrm
399 $ cat >> .hg/hgrc <<EOF
400 > [hooks]
401 > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A"
402 > EOF
403 $ touch foo
404 $ hg add --large foo
405 $ hg ci -m "add foo"
406 Invoking status precommit hook
407 A foo
408 Invoking status postcommit hook
409 C foo
410 C normal3
411 C sub/large4
412 C sub/normal4
413 C sub2/large6
414 C sub2/large7
415 $ rm foo
416 $ hg st
417 ! foo
418 hmm.. no precommit invoked, but there is a postcommit??
419 $ hg ci -m "will not checkin"
420 nothing changed
421 Invoking status postcommit hook
422 ! foo
423 C normal3
424 C sub/large4
425 C sub/normal4
426 C sub2/large6
427 C sub2/large7
428 [1]
429 $ hg addremove
430 removing foo
431 $ hg st
432 R foo
433 $ hg ci -m "used to say nothing changed"
434 Invoking status precommit hook
435 R foo
436 Invoking status postcommit hook
437 C normal3
438 C sub/large4
439 C sub/normal4
440 C sub2/large6
441 C sub2/large7
442 $ hg st
443 $ cd ../a
444
392 Clone a largefiles repo.
445 Clone a largefiles repo.
393
446
394 $ hg clone . ../b
447 $ hg clone . ../b
General Comments 0
You need to be logged in to leave comments. Login now