Patchwork [2,of,2] largefiles: use clearer debug messages in actions

login
register
mail settings
Submitter Martin von Zweigbergk
Date Dec. 3, 2014, 7:45 p.m.
Message ID <25c203200a61797194d6.1417635927@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6984/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Dec. 3, 2014, 7:45 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1416603765 28800
#      Fri Nov 21 13:02:45 2014 -0800
# Node ID 25c203200a61797194d63567af43a64327dd8d3e
# Parent  e615814e438cbe0254d89252e4f1ad385baac022
largefiles: use clearer debug messages in actions

In overridecalculateupdates(), 'g' (get) actions may be converted into
other actions. In most of these cases, it does not make sense to keep
the action's message. For example, 'remote created' does not make
sense for an 'r' (remove) action.
Mads Kiilerich - Dec. 4, 2014, 3:52 a.m.
On 12/03/2014 08:45 PM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1416603765 28800
> #      Fri Nov 21 13:02:45 2014 -0800
> # Node ID 25c203200a61797194d63567af43a64327dd8d3e
> # Parent  e615814e438cbe0254d89252e4f1ad385baac022
> largefiles: use clearer debug messages in actions
>
> In overridecalculateupdates(), 'g' (get) actions may be converted into
> other actions. In most of these cases, it does not make sense to keep
> the action's message. For example, 'remote created' does not make
> sense for an 'r' (remove) action.

A bit surprising we don't have any test coverage for these debug messages.

Anyway, series LGTM.

/Mads
Matt Mackall - Dec. 5, 2014, 12:27 a.m.
On Wed, 2014-12-03 at 11:45 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1416603765 28800
> #      Fri Nov 21 13:02:45 2014 -0800
> # Node ID 25c203200a61797194d63567af43a64327dd8d3e
> # Parent  e615814e438cbe0254d89252e4f1ad385baac022
> largefiles: use clearer debug messages in actions

These are queued for default (with the indent fix), thanks.

Patch

diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py
+++ b/hgext/largefiles/overrides.py
@@ -449,10 +449,10 @@ 
                 # else, prompt
                 repo.ui.promptchoice(usermsg, 0) == 0
                 ): # pick remote largefile
-                actions['r'].append((lfile, None, msg))
+                actions['r'].append((lfile, None, 'replaced by standin'))
                 newglist.append((standin, (p2.flags(standin),), msg))
             else: # keep local normal file
-                actions['r'].append((standin, None, msg))
+                actions['r'].append((standin, None, 'replaced by non-standin'))
         elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes:
             # Case 2: largefile in the working copy, normal file in
             # the second parent
@@ -472,16 +472,16 @@ 
                 ): # keep local largefile
                 if branchmerge:
                     # largefile can be restored from standin safely
-                    actions['r'].append((lfile, None, msg))
+                    actions['r'].append((lfile, None, 'replaced by standin'))
                 else:
                     # "lfile" should be marked as "removed" without
                     # removal of itself
-                    lfmr.append((lfile, None, msg))
+                    lfmr.append((lfile, None, 'forget non-standin largefile'))
 
                     # linear-merge should treat this largefile as 're-added'
-                    actions['a'].append((standin, None, msg))
+                    actions['a'].append((standin, None, 'keep standin'))
             else: # pick remote normal file
-                actions['r'].append((standin, None, msg))
+                actions['r'].append((standin, None, 'replaced by non-standin'))
                 newglist.append((lfile, (p2.flags(lfile),), msg))
         else:
             newglist.append(action)