diff -r 7cbba3adabc7 -r 3ef07ecdb0d5 hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py Sat Jan 07 12:42:54 2012 +0100 +++ b/hgext/largefiles/lfcommands.py Sat Jan 07 18:43:34 2012 +0100 @@ -455,7 +455,13 @@ ret = -1 state = repo.dirstate[lfutil.standin(lfile)] if state == 'n': - lfdirstate.normal(lfile) + # When rebasing, we need to synchronize the standin and the largefile, + # because otherwise the largefile will get reverted. But for commit's + # sake, we have to mark the file as unclean. + if getattr(repo, "_isrebasing", False): + lfdirstate.normallookup(lfile) + else: + lfdirstate.normal(lfile) elif state == 'r': lfdirstate.remove(lfile) elif state == 'a':