D5907: copy: respect ui.relative-paths in copy/rename

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

D5907: copy: respect ui.relative-paths in copy/rename

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/D5907

AFFECTED FILES
  mercurial/cmdutil.py

CHANGE DETAILS

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1135,6 +1135,7 @@
     dryrun = opts.get("dry_run")
     wctx = repo[None]
 
+    uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
     def walkpat(pat):
         srcs = []
         if after:
@@ -1144,7 +1145,7 @@
         m = scmutil.match(wctx, [pat], opts, globbed=True)
         for abs in wctx.walk(m):
             state = repo.dirstate[abs]
-            rel = m.rel(abs)
+            rel = uipathfn(abs)
             exact = m.exact(abs)
             if state in badstates:
                 if exact and state == '?':



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
|

D5907: copy: respect ui.relative-paths in copy/rename

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5907?vs=13932&id=13933

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/scmutil.py
  tests/test-copy.t

CHANGE DETAILS

diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -118,6 +118,23 @@
   [255]
   $ hg st -A
   ? foo
+respects ui.relative-paths
+  $ mkdir dir
+  $ cd dir
+  $ hg mv ../foo ../bar
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=yes
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=no
+  foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ cd ..
+  $ rmdir dir
   $ hg add foo
 dry-run; print a warning that this is not a real copy; foo is added
   $ hg mv --dry-run foo bar
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -51,8 +51,10 @@
 )
 
 if pycompat.iswindows:
+    from . import windows as platform
     from . import scmwindows as scmplatform
 else:
+    from . import posix as platform
     from . import scmposix as scmplatform
 
 parsers = policy.importmod(r'parsers')
@@ -757,7 +759,7 @@
         pathto = repo.pathto
         return lambda f: pathto(f, cwd)
     else:
-        return lambda f: f
+        return platform.localpath
 
 def subdiruipathfn(subpath, uipathfn):
     '''Create a new uipathfn that treats the file as relative to subpath.'''
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1135,6 +1135,7 @@
     dryrun = opts.get("dry_run")
     wctx = repo[None]
 
+    uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
     def walkpat(pat):
         srcs = []
         if after:
@@ -1144,7 +1145,7 @@
         m = scmutil.match(wctx, [pat], opts, globbed=True)
         for abs in wctx.walk(m):
             state = repo.dirstate[abs]
-            rel = m.rel(abs)
+            rel = uipathfn(abs)
             exact = m.exact(abs)
             if state in badstates:
                 if exact and state == '?':
@@ -2188,7 +2189,7 @@
                     ret = 0
             except error.LookupError:
                 ui.status(_("skipping missing subrepository: %s\n")
-                               % m.rel(subpath))
+                               % uipathfn(subpath))
 
     return ret
 
@@ -2819,7 +2820,7 @@
                 for f in names:
                     if f.startswith(path_):
                         return
-                ui.warn("%s: %s\n" % (m.rel(path), msg))
+                ui.warn("%s: %s\n" % (uipathfn(path), msg))
 
             for abs in ctx.walk(matchmod.badmatch(m, badfn)):
                 if abs not in names:



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
|

D5907: copy: respect ui.relative-paths in copy/rename

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5907?vs=13933&id=13934

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/scmutil.py
  tests/test-copy.t

CHANGE DETAILS

diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -118,6 +118,23 @@
   [255]
   $ hg st -A
   ? foo
+respects ui.relative-paths
+  $ mkdir dir
+  $ cd dir
+  $ hg mv ../foo ../bar
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=yes
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=no
+  foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ cd ..
+  $ rmdir dir
   $ hg add foo
 dry-run; print a warning that this is not a real copy; foo is added
   $ hg mv --dry-run foo bar
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -51,8 +51,10 @@
 )
 
 if pycompat.iswindows:
+    from . import windows as platform
     from . import scmwindows as scmplatform
 else:
+    from . import posix as platform
     from . import scmposix as scmplatform
 
 parsers = policy.importmod(r'parsers')
@@ -757,7 +759,7 @@
         pathto = repo.pathto
         return lambda f: pathto(f, cwd)
     else:
-        return lambda f: f
+        return platform.localpath
 
 def subdiruipathfn(subpath, uipathfn):
     '''Create a new uipathfn that treats the file as relative to subpath.'''
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1135,6 +1135,7 @@
     dryrun = opts.get("dry_run")
     wctx = repo[None]
 
+    uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
     def walkpat(pat):
         srcs = []
         if after:
@@ -1144,7 +1145,7 @@
         m = scmutil.match(wctx, [pat], opts, globbed=True)
         for abs in wctx.walk(m):
             state = repo.dirstate[abs]
-            rel = m.rel(abs)
+            rel = uipathfn(abs)
             exact = m.exact(abs)
             if state in badstates:
                 if exact and state == '?':



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
|

D5907: copy: respect ui.relative-paths in copy/rename

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5907?vs=13934&id=13977

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

AFFECTED FILES
  mercurial/cmdutil.py
  mercurial/scmutil.py
  tests/test-copy.t

CHANGE DETAILS

diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -118,6 +118,23 @@
   [255]
   $ hg st -A
   ? foo
+respects ui.relative-paths
+  $ mkdir dir
+  $ cd dir
+  $ hg mv ../foo ../bar
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=yes
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=no
+  foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ cd ..
+  $ rmdir dir
   $ hg add foo
 dry-run; print a warning that this is not a real copy; foo is added
   $ hg mv --dry-run foo bar
diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -51,8 +51,10 @@
 )
 
 if pycompat.iswindows:
+    from . import windows as platform
     from . import scmwindows as scmplatform
 else:
+    from . import posix as platform
     from . import scmposix as scmplatform
 
 parsers = policy.importmod(r'parsers')
@@ -757,7 +759,7 @@
         pathto = repo.pathto
         return lambda f: pathto(f, cwd)
     else:
-        return lambda f: f
+        return platform.localpath
 
 def subdiruipathfn(subpath, uipathfn):
     '''Create a new uipathfn that treats the file as relative to subpath.'''
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1135,6 +1135,7 @@
     dryrun = opts.get("dry_run")
     wctx = repo[None]
 
+    uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
     def walkpat(pat):
         srcs = []
         if after:
@@ -1144,7 +1145,7 @@
         m = scmutil.match(wctx, [pat], opts, globbed=True)
         for abs in wctx.walk(m):
             state = repo.dirstate[abs]
-            rel = m.rel(abs)
+            rel = uipathfn(abs)
             exact = m.exact(abs)
             if state in badstates:
                 if exact and state == '?':



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
|

Re: D5907: copy: respect ui.relative-paths in copy/rename

Yuya Nishihara
> --- a/mercurial/scmutil.py
> +++ b/mercurial/scmutil.py
> @@ -51,8 +51,10 @@
>  )
>  
>  if pycompat.iswindows:
> +    from . import windows as platform
>      from . import scmwindows as scmplatform
>  else:
> +    from . import posix as platform
>      from . import scmposix as scmplatform

It's `util.localpath()`.

> @@ -757,7 +759,7 @@
>          pathto = repo.pathto
>          return lambda f: pathto(f, cwd)
>      else:
> -        return lambda f: f
> +        return platform.localpath

I've removed this since it seemed unrelated to this specific patch. It might
break some Windows tests, but it should already be broken since a997163e7fae.
Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5907: copy: respect ui.relative-paths in copy/rename

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 rHGe41449818bee: copy: respect ui.relative-paths in copy/rename (authored by martinvonz, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D5907?vs=13977&id=13989#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5907?vs=13977&id=13989

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

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

CHANGE DETAILS

diff --git a/tests/test-copy.t b/tests/test-copy.t
--- a/tests/test-copy.t
+++ b/tests/test-copy.t
@@ -118,6 +118,23 @@
   [255]
   $ hg st -A
   ? foo
+respects ui.relative-paths
+  $ mkdir dir
+  $ cd dir
+  $ hg mv ../foo ../bar
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=yes
+  ../foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ hg mv ../foo ../bar --config ui.relative-paths=no
+  foo: not copying - file is not managed
+  abort: no files to copy
+  [255]
+  $ cd ..
+  $ rmdir dir
   $ hg add foo
 dry-run; print a warning that this is not a real copy; foo is added
   $ hg mv --dry-run foo bar
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -1135,6 +1135,7 @@
     dryrun = opts.get("dry_run")
     wctx = repo[None]
 
+    uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
     def walkpat(pat):
         srcs = []
         if after:
@@ -1144,7 +1145,7 @@
         m = scmutil.match(wctx, [pat], opts, globbed=True)
         for abs in wctx.walk(m):
             state = repo.dirstate[abs]
-            rel = m.rel(abs)
+            rel = uipathfn(abs)
             exact = m.exact(abs)
             if state in badstates:
                 if exact and state == '?':



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
|

D5907: copy: respect ui.relative-paths in copy/rename

pulkit (Pulkit Goyal)
In reply to this post by Yuya Nishihara
yuja added a comment.


  > - a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -51,8 +51,10 @@ )
  >
  >   if pycompat.iswindows: +    from . import windows as platform from . import scmwindows as scmplatform else: +    from . import posix as platform from . import scmposix as scmplatform
 
  It's `util.localpath()`.
 
  > @@ -757,7 +759,7 @@
  >
  >       pathto = repo.pathto
  >       return lambda f: pathto(f, cwd)
  >   else:
  >
  > - return lambda f: f +        return platform.localpath
 
  I've removed this since it seemed unrelated to this specific patch. It might
  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, 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
|

D5907: copy: respect ui.relative-paths in copy/rename

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


  In https://phab.mercurial-scm.org/D5907#86561, @yuja wrote:
 
  > > - a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -51,8 +51,10 @@ )
  > >
  > >   if pycompat.iswindows: +    from . import windows as platform from . import scmwindows as scmplatform else: +    from . import posix as platform from . import scmposix as scmplatform
  >
  > It's `util.localpath()`.
  >
  > > @@ -757,7 +759,7 @@
  > >
  > >       pathto = repo.pathto
  > >       return lambda f: pathto(f, cwd)
  > >   else:
  > >
  > > - return lambda f: f +        return platform.localpath
  >
  > I've removed this since it seemed unrelated to this specific patch.
 
 
  That was just something I was experimenting with and must have accidentally amended in. Thanks for fixing!
 
  > It might
  >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
  >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
 
  Did that commit change any behavior on Windows? I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, 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
|

Re: D5907: copy: respect ui.relative-paths in copy/rename

Yuya Nishihara
>   > It might
>   >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
>   >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
>  
>   Did that commit change any behavior on Windows?

Probably. `pathto(f, cwd='')` would return backslash path on Windows.

> I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)

Correct. Path handling on Windows seemed inconsistent from the start. Some
commands used to use `dirstate.pathto()` which always returns backslash/slash
paths depending on ui.slash, and the others using `m.rel|abs|uipath()` don't.

Since we have `scmutil.getuipathfn()` now, maybe we can fix the inconsistency?
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5907: copy: respect ui.relative-paths in copy/rename

pulkit (Pulkit Goyal)
yuja added a comment.


  >   > It might
  >   >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
  >   >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
  >  
  >   Did that commit change any behavior on Windows?
 
  Probably. `pathto(f, cwd='')` would return backslash path on Windows.
 
  > I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)
 
  Correct. Path handling on Windows seemed inconsistent from the start. Some
  commands used to use `dirstate.pathto()` which always returns backslash/slash
  paths depending on ui.slash, and the others using `m.rel|abs|uipath()` don't.
 
  Since we have `scmutil.getuipathfn()` now, maybe we can fix the inconsistency?

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, 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
|

D5907: copy: respect ui.relative-paths in copy/rename

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


  In https://phab.mercurial-scm.org/D5907#86625, @yuja wrote:
 
  > >   > It might
  > >   >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
  > >   >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
  > >  
  > >   Did that commit change any behavior on Windows?
  >
  > Probably. `pathto(f, cwd='')` would return backslash path on Windows.
 
 
  `getuipathfn()` uses `repo.pathto()` when a relative path was requested (including by setting `legacyrelativevalue=True` or `forcerelativevalue=True`), so I think there shouldn't be much change in behavior with that commit.
 
  >
  >
  >> I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)
  >
  > Correct. Path handling on Windows seemed inconsistent from the start. Some
  >  commands used to use `dirstate.pathto()` which always returns backslash/slash
  >  paths depending on ui.slash, and the others using `m.rel|abs|uipath()` don't.
  >
  > Since we have `scmutil.getuipathfn()` now, maybe we can fix the inconsistency?
 
  Yep, I was going to switch from `lambda f: f` to `util.localpath` for repo-relative paths. I was leaving that for when I'm done with the rest in case it affects tests on Windows, so they don't need to be updated several times.
 
  In https://phab.mercurial-scm.org/D5907#86625, @yuja wrote:
 
  > >   > It might
  > >   >  break some Windows tests, but it should already be broken since https://phab.mercurial-scm.org/rHGa997163e7fae2fe933f8d0c6d1013205befd1ee4.
  > >   >  Some (or all?) `uipathfn()`s have to respect `ui.slash` config on Windows.
  > >  
  > >   Did that commit change any behavior on Windows?
  >
  > Probably. `pathto(f, cwd='')` would return backslash path on Windows.
  >
  > > I was trying to figure out where the conversion to Windows paths was done and thought it seemed like it was mostly just done in `util.pathto()`, so e.g. `m.rel()` would use backslashes and `m.abs()` would use slashes. (I just learned that there is a deprecated ui.slash config too, but that doesn't seem to change much.)
  >
  > Correct. Path handling on Windows seemed inconsistent from the start. Some
  >  commands used to use `dirstate.pathto()` which always returns backslash/slash
  >  paths depending on ui.slash, and the others using `m.rel|abs|uipath()` don't.
  >
  > Since we have `scmutil.getuipathfn()` now, maybe we can fix the inconsistency?

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, 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
|

Re: D5907: copy: respect ui.relative-paths in copy/rename

Yuya Nishihara
>   `getuipathfn()` uses `repo.pathto()` when a relative path was requested (including by setting `legacyrelativevalue=True` or `forcerelativevalue=True`), so I think there shouldn't be much change in behavior with that commit.

But the default of `hg status` is `relative=False`, so the status output
would have significant change on Windows.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

D5907: copy: respect ui.relative-paths in copy/rename

pulkit (Pulkit Goyal)
yuja added a comment.


  >   `getuipathfn()` uses `repo.pathto()` when a relative path was requested (including by setting `legacyrelativevalue=True` or `forcerelativevalue=True`), so I think there shouldn't be much change in behavior with that commit.
 
  But the default of `hg status` is `relative=False`, so the status output
  would have significant change on Windows.

REPOSITORY
  rHG Mercurial

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

To: martinvonz, #hg-reviewers
Cc: yuja, 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
|

D5907: copy: respect ui.relative-paths in copy/rename

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


  In https://phab.mercurial-scm.org/D5907#86706, @yuja wrote:
 
  > >   `getuipathfn()` uses `repo.pathto()` when a relative path was requested (including by setting `legacyrelativevalue=True` or `forcerelativevalue=True`), so I think there shouldn't be much change in behavior with that commit.
  >
  > But the default of `hg status` is `relative=False`, so the status output
  >  would have significant change on Windows.
 
 
  Ohhh, now I see! `hg status` changed because it used `repo.pathto(f, cwd='')` in the non-relative case, and `repo.pathto()` calls `uitil.localpath()`. I think most or all of the other commands I've changed with recent patches simply use `f` the non-relative case. So I have hopefully only broken `hg status`. But I'll hopefully fix almost all of them to use native paths soon :)

REPOSITORY
  rHG Mercurial

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

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