Patchwork [8,of,8] largefiles: remove redundant "updatelfiles" invocation in "lfilesrepo.commit"

login
register
mail settings
Submitter Katsunori FUJIWARA
Date Aug. 24, 2014, 2:54 p.m.
Message ID <7ec38ae2a22869743366.1408892094@feefifofum>
Download mbox | patch
Permalink /patch/5574/
State Accepted
Headers show

Comments

Katsunori FUJIWARA - Aug. 24, 2014, 2:54 p.m.
# HG changeset patch
# User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
# Date 1408891646 -32400
#      Sun Aug 24 23:47:26 2014 +0900
# Node ID 7ec38ae2a22869743366d914e4c856a554ad45f8
# Parent  ade8e834be33b2f9c02112d68bf1dfabfbd4d28d
largefiles: remove redundant "updatelfiles" invocation in "lfilesrepo.commit"

After previous patches, largefiles in the working directory are
ensured to be updated before "repo.commit" invocation for automated
committing below:

  - by "overrides.mergeupdate" via "merge.update" for rebase
  - by "overrides.scmutilmarktouched" via "patch.patch" for transplant

This patch removes redundant "lfcommands.updatelfiles" invocation in
"Case 0" code path of "lfilesrepo.commit" for automated committing,
and revises detailed comment.
Matt Mackall - Aug. 27, 2014, 10:15 a.m.
On Sun, 2014-08-24 at 23:54 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
> # Date 1408891646 -32400
> #      Sun Aug 24 23:47:26 2014 +0900
> # Node ID 7ec38ae2a22869743366d914e4c856a554ad45f8
> # Parent  ade8e834be33b2f9c02112d68bf1dfabfbd4d28d
> largefiles: remove redundant "updatelfiles" invocation in "lfilesrepo.commit"

Very nice. These are queued for default.

Patch

diff --git a/hgext/largefiles/reposetup.py b/hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py
+++ b/hgext/largefiles/reposetup.py
@@ -272,17 +272,17 @@ 
 
             wlock = self.wlock()
             try:
-                # Case 0: Rebase or Transplant
-                # We have to take the time to pull down the new largefiles now.
-                # Otherwise, any largefiles that were modified in the
-                # destination changesets get overwritten, either by the rebase
-                # or in the first commit after the rebase or transplant.
-                # updatelfiles will update the dirstate to mark any pulled
-                # largefiles as modified
+                # Case 0: Automated committing
+                #
+                # While automated committing (like rebase, transplant
+                # and so on), this code path is used to avoid:
+                # (1) updating standins, because standins should
+                #     be already updated at this point
+                # (2) aborting when stadnins are matched by "match",
+                #     because automated committing may specify them directly
+                #
                 if getattr(self, "_isrebasing", False) or \
                         getattr(self, "_istransplanting", False):
-                    lfcommands.updatelfiles(self.ui, self, filelist=None,
-                                            printmessage=False)
                     result = orig(text=text, user=user, date=date, match=match,
                                     force=force, editor=editor, extra=extra)