Patchwork [1,of,7,mergedriver] commands.resolve: support printing out driver-resolved files

login
register
mail settings
Submitter Siddharth Agarwal
Date Oct. 17, 2015, 2:35 a.m.
Message ID <b7d49ea007826ec28354.1445049314@dev6666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11156/
State Accepted
Headers show

Comments

Siddharth Agarwal - Oct. 17, 2015, 2:35 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1444895120 25200
#      Thu Oct 15 00:45:20 2015 -0700
# Node ID b7d49ea007826ec28354bb67b10f651a5cbbf905
# Parent  e1568d5eb0522b3ab20a1cbb15ec06f6d198c9a8
commands.resolve: support printing out driver-resolved files

There's no user-visible way to mark files as driver-resolved, so this status
won't be visible.
Pierre-Yves David - Oct. 18, 2015, 12:46 p.m.
On 10/17/2015 04:35 AM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1444895120 25200
> #      Thu Oct 15 00:45:20 2015 -0700
> # Node ID b7d49ea007826ec28354bb67b10f651a5cbbf905
> # Parent  e1568d5eb0522b3ab20a1cbb15ec06f6d198c9a8
> commands.resolve: support printing out driver-resolved files
>
> There's no user-visible way to mark files as driver-resolved, so this status
> won't be visible.
>
> diff --git a/mercurial/commands.py b/mercurial/commands.py
> --- a/mercurial/commands.py
> +++ b/mercurial/commands.py
> @@ -5563,7 +5563,8 @@ def resolve(ui, repo, *pats, **opts):
>           for f in ms:
>               if not m(f):
>                   continue
> -            l = 'resolve.' + {'u': 'unresolved', 'r': 'resolved'}[ms[f]]
> +            l = 'resolve.' + {'u': 'unresolved', 'r': 'resolved',
> +                              'd': 'driverresolved'}[ms[f]]

By the way, this is kind of awful. Can you move this dictionary outside 
of the function ?

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5563,7 +5563,8 @@  def resolve(ui, repo, *pats, **opts):
         for f in ms:
             if not m(f):
                 continue
-            l = 'resolve.' + {'u': 'unresolved', 'r': 'resolved'}[ms[f]]
+            l = 'resolve.' + {'u': 'unresolved', 'r': 'resolved',
+                              'd': 'driverresolved'}[ms[f]]
             fm.startitem()
             fm.condwrite(not nostatus, 'status', '%s ', ms[f].upper(), label=l)
             fm.write('path', '%s\n', f, label=l)