D3946: obsolete: resolved ValueError for var containing 2 ':' chars(issue-5783)

2020-01-24 Thread baymax (Baymax, Your Personal Patch-care Companion)
This revision now requires changes to proceed.
baymax added a comment.
baymax requested changes to this revision.


  There seems to have been no activities on this Diff for the past 3 Months.
  
  By policy, we are automatically moving it out of the `need-review` state.
  
  Please, move it back to `need-review` without hesitation if this diff should 
still be discussed.
  
  :baymax:need-review-idle:

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D3946/new/

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

To: abhyudaypratap, #hg-reviewers, baymax
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


Re: D3946: obsolete: resolved ValueError for var containing 2 ':' chars(issue-5783)

2018-07-15 Thread Yuya Nishihara
Looks good. Can you add a test?

https://www.mercurial-scm.org/wiki/ContributingChanges#Coding_style_and_testing

The version 0 format can be enforced by `--config format.obsstore-version=0`.
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3946: obsolete: resolved ValueError for var containing 2 ':' chars(issue-5783)

2018-07-15 Thread yuja (Yuya Nishihara)
yuja added a comment.


  Looks good. Can you add a test?
  
  
https://www.mercurial-scm.org/wiki/ContributingChanges#Coding_style_and_testing
  
  The version 0 format can be enforced by `--config format.obsstore-version=0`.

REPOSITORY
  rHG Mercurial

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

To: abhyudaypratap, #hg-reviewers
Cc: yuja, mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D3946: obsolete: resolved ValueError for var containing 2 ':' chars(issue-5783)

2018-07-14 Thread abhyudaypratap (ABHYUDAY PRATAP SINGH)
abhyudaypratap created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  feature Note accepts ':' chars
  So metadata of obsmarker consists of more then 1 ':' char,
  The content of the variable 'data' in this function is:
  'date:1518013344.878793 
-3600\x00ef1:0\x00note:6c95ca::a1e17f\x00p1:ed7673f73387b36521da58a87f08e02e4a795ded\x00user:Denis
 Laxalde '
  
  resulting in giving a error ValueError (too many values to unpack) because we 
are trying to store multiple values into two variables key and value
  
  Resolving this error by splitting the variable 'l' from the first occurence 
of ':'
  key, value = l.split("", 1)

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/obsolete.py

CHANGE DETAILS

diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py
--- a/mercurial/obsolete.py
+++ b/mercurial/obsolete.py
@@ -275,7 +275,7 @@
 d = {}
 for l in data.split('\0'):
 if l:
-key, value = l.split(':')
+key, value = l.split(':', 1)
 d[key] = value
 return d
 



To: abhyudaypratap, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel