D5801: files: respect ui.relative-paths

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-locate.t

CHANGE DETAILS

diff --git a/tests/test-locate.t b/tests/test-locate.t
--- a/tests/test-locate.t
+++ b/tests/test-locate.t
@@ -123,6 +123,24 @@
   ../t.h
   ../t/e.h
   ../t/x
+  $ hg files --config ui.relative-paths=yes
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
+  $ hg files --config ui.relative-paths=no
+  b
+  dir.h/foo
+  t.h
+  t/e.h
+  t/x
+  $ hg files --config ui.relative-paths=legacy
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
 
   $ hg locate b
   ../b
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2162,14 +2162,15 @@
     ret = 1
 
     needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
+    uipathfn = scmutil.getuipathfn(ctx.repo(), legacyvalue=True)
     for f in ctx.matches(m):
         fm.startitem()
         fm.context(ctx=ctx)
         if needsfctx:
             fc = ctx[f]
             fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
         fm.data(path=f)
-        fm.plain(fmt % m.rel(f))
+        fm.plain(fmt % uipathfn(f))
         ret = 0
 
     for subpath in sorted(ctx.substate):



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
martinvonz updated this revision to Diff 13733.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5801?vs=13699&id=13733

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-locate.t

CHANGE DETAILS

diff --git a/tests/test-locate.t b/tests/test-locate.t
--- a/tests/test-locate.t
+++ b/tests/test-locate.t
@@ -123,6 +123,24 @@
   ../t.h
   ../t/e.h
   ../t/x
+  $ hg files --config ui.relative-paths=yes
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
+  $ hg files --config ui.relative-paths=no
+  b
+  dir.h/foo
+  t.h
+  t/e.h
+  t/x
+  $ hg files --config ui.relative-paths=legacy
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
 
   $ hg locate b
   ../b
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2162,14 +2162,15 @@
     ret = 1
 
     needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
+    uipathfn = scmutil.getuipathfn(ctx.repo(), legacyvalue=True)
     for f in ctx.matches(m):
         fm.startitem()
         fm.context(ctx=ctx)
         if needsfctx:
             fc = ctx[f]
             fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
         fm.data(path=f)
-        fm.plain(fmt % m.rel(f))
+        fm.plain(fmt % uipathfn(f))
         ret = 0
 
     for subpath in sorted(ctx.substate):



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
martinvonz updated this revision to Diff 13812.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5801?vs=13733&id=13812

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-locate.t

CHANGE DETAILS

diff --git a/tests/test-locate.t b/tests/test-locate.t
--- a/tests/test-locate.t
+++ b/tests/test-locate.t
@@ -123,6 +123,24 @@
   ../t.h
   ../t/e.h
   ../t/x
+  $ hg files --config ui.relative-paths=yes
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
+  $ hg files --config ui.relative-paths=no
+  b
+  dir.h/foo
+  t.h
+  t/e.h
+  t/x
+  $ hg files --config ui.relative-paths=legacy
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
 
   $ hg locate b
   ../b
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2162,14 +2162,15 @@
     ret = 1
 
     needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
+    uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True)
     for f in ctx.matches(m):
         fm.startitem()
         fm.context(ctx=ctx)
         if needsfctx:
             fc = ctx[f]
             fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
         fm.data(path=f)
-        fm.plain(fmt % m.rel(f))
+        fm.plain(fmt % uipathfn(f))
         ret = 0
 
     for subpath in sorted(ctx.substate):



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGce0a4ed25ebc: files: respect ui.relative-paths (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5801?vs=13812&id=13837

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

AFFECTED FILES
  mercurial/cmdutil.py
  tests/test-locate.t

CHANGE DETAILS

diff --git a/tests/test-locate.t b/tests/test-locate.t
--- a/tests/test-locate.t
+++ b/tests/test-locate.t
@@ -123,6 +123,24 @@
   ../t.h
   ../t/e.h
   ../t/x
+  $ hg files --config ui.relative-paths=yes
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
+  $ hg files --config ui.relative-paths=no
+  b
+  dir.h/foo
+  t.h
+  t/e.h
+  t/x
+  $ hg files --config ui.relative-paths=legacy
+  ../b
+  ../dir.h/foo
+  ../t.h
+  ../t/e.h
+  ../t/x
 
   $ hg locate b
   ../b
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2164,14 +2164,15 @@
     ret = 1
 
     needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
+    uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True)
     for f in ctx.matches(m):
         fm.startitem()
         fm.context(ctx=ctx)
         if needsfctx:
             fc = ctx[f]
             fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
         fm.data(path=f)
-        fm.plain(fmt % m.rel(f))
+        fm.plain(fmt % uipathfn(f))
         ret = 0
 
     for subpath in sorted(ctx.substate):



To: martinvonz, #hg-reviewers
Cc: mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
mharbison72 added a comment.


  For some reason, this breaks test-contrib-perf.t:
 
  https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/1274/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
 
  I also tried setting True and False in ui.relative-paths, to no effect.  Any ideas?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D5801#87273, @mharbison72 wrote:
 
  > For some reason, this breaks test-contrib-perf.t:
  >
  > https://buildbot.mercurial-scm.org/builders/Win7%20x86_64%20hg%20tests/builds/1274/steps/run-tests.py%20%28python%202.7.13%29/logs/stdio
  >
  > I also tried setting True and False in ui.relative-paths, to no effect.  Any ideas?
 
 
  I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
mharbison72 added a comment.


  In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote:
 
  > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though.
 
 
  The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences.  The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
martinvonz added a comment.


  In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote:
 
  > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote:
  >
  > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though.
  >
  >
  > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences.  The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway.
 
 
  Ah, so the only difference is the extra "import newer module separately in try clause for early Mercurial" in `contrib/perf.py` then. This patch didn't change that file. Can you check again that it was this patch that caused that and that it's not just flaky?
 
  In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote:
 
  > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote:
  >
  > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though.
  >
  >
  > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences.  The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5801: files: respect ui.relative-paths

pulkit (Pulkit Goyal)
In reply to this post by pulkit (Pulkit Goyal)
mharbison72 added a comment.


  In https://phab.mercurial-scm.org/D5801#87302, @martinvonz wrote:
 
  > In https://phab.mercurial-scm.org/D5801#87300, @mharbison72 wrote:
  >
  > > In https://phab.mercurial-scm.org/D5801#87296, @martinvonz wrote:
  > >
  > > > I noticed another bug and sent https://phab.mercurial-scm.org/D5978. Maybe your test failure is because you're using the eol extension? I don't know what else would cause the \r in contrib.perf. I have no idea how that's related to this patch, though.
  > >
  > >
  > > The \r is how output normally is on Windows. The test harness accounts for this when matching lines, but displays the actual output (with \r) when there are differences.  The eol extension isn’t configured on this machine, but the custom HGRCPATH content from the test harness would override that anyway.
  >
  >
  > Ah, so the only difference is the extra "import newer module separately in try clause for early Mercurial" in `contrib/perf.py` then. This patch didn't change that file. Can you check again that it was this patch that caused that and that it's not just flaky?
 
 
  Correct.  The extra noise makes it hard to see the actual problems sometimes, and it makes trivial things like fixing (glob) endings more of a nuisance.  But I don't see a way to handle that.
 
  This one is definitely the problem, because the failing *.t invokes `hg files` to generate the whitelist.  It turns out, we can either set `ui.slash=False` or just not use `os.sep` in check-perf-code.py.  I'm leaning toward the latter.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5801

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel