Re: Using rbt post to review topmost patch of mq series

2014-06-10 Thread Christian Hammond
Hi Bruce,

You may have seen a couple other threads today on the list about Mercurial and 
issues with revisions. Based on those, and the testing you’ve done, do you 
think this patch would fix those issues?

Christian

-- 
Christian Hammond - christ...@beanbaginc.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

On June 9, 2014 at 3:38:55 PM, Bruce Cran (bruce.c...@gmail.com) wrote:

I think the following should fix the problem: if we can't fetch a file using 
the revision recorded in the diff, try using the base commit id instead:

diff --git a/reviewboard/scmtools/models.py b/reviewboard/scmtools/models.py
index 7f1dd43..820814b 100644
--- a/reviewboard/scmtools/models.py
+++ b/reviewboard/scmtools/models.py
@@ -17,6 +17,7 @@ from reviewboard.scmtools.managers import RepositoryManager, 
ToolManager
 from reviewboard.scmtools.signals import (checked_file_exists,
   checking_file_exists,
   fetched_file, fetching_file)
+from reviewboard.scmtools.core import FileNotFoundError
 from reviewboard.site.models import LocalSite


@@ -367,7 +368,10 @@ class Repository(models.Model):
 revision,
 base_commit_id=base_commit_id)
 else:
-    data = self.get_scmtool().get_file(path, revision)
+    try:
+    data = self.get_scmtool().get_file(path, revision)
+    except FileNotFoundError:
+    data = self.get_scmtool().get_file(path, base_commit_id)

 log_timer.done()



On Thu, Jun 5, 2014 at 2:50 PM, Bruce Cran bruce.c...@gmail.com wrote:
I don't know if it used to work with RBTools, but people have said it used to 
work with 'hg postreview -m qparent'.
Running 'rbt post tip' or 'rbt post --parent=qparent tip' results in Review 
Board saying it can't display the diff where there are changes in a file which 
also has changes in other patches (which, since they haven't been pushed yet, 
are unknown to RB).

--
Bruce



On Thu, Jun 5, 2014 at 2:37 PM, Christian Hammond christ...@beanbaginc.com 
wrote:

I don’t know of anything on the RB side that would have changed here. It should 
just accept what’s given by the client. Were you able to do it before with 
RBTools?

If you’re just trying to post the top-most commit, then (at least with Git) 
you’d do:

    $ rbt post HEAD

Replace HEAD with whatever you need to identify the particular commit you care 
about. RBTools should take care of calculating the parent for you.




--
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using rbt post to review topmost patch of mq series

2014-06-10 Thread Bruce Cran
Christian,

No, my patch (also posted at https://reviews.reviewboard.org/r/5965/) only
appears to fix the problem with parent diffs: I've had users complaining
today both that valid patches won't upload or that the diff viewer doesn't
work for existing reviews (FileNotFoundError: The file 'code.py' (rNone)
could not be found in the repository) - since the patches don't contain
revision info.

-- 
Bruce

On Tue, Jun 10, 2014 at 5:54 PM, Christian Hammond christ...@beanbaginc.com
 wrote:

 Hi Bruce,

 You may have seen a couple other threads today on the list about Mercurial
 and issues with revisions. Based on those, and the testing you’ve done, do
 you think this patch would fix those issues?


-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using rbt post to review topmost patch of mq series

2014-06-09 Thread Bruce Cran
I think the following should fix the problem: if we can't fetch a file
using the revision recorded in the diff, try using the base commit id
instead:

diff --git a/reviewboard/scmtools/models.py b/reviewboard/scmtools/models.py
index 7f1dd43..820814b 100644
--- a/reviewboard/scmtools/models.py
+++ b/reviewboard/scmtools/models.py
@@ -17,6 +17,7 @@ from reviewboard.scmtools.managers import
RepositoryManager, ToolManager
 from reviewboard.scmtools.signals import (checked_file_exists,
   checking_file_exists,
   fetched_file, fetching_file)
+from reviewboard.scmtools.core import FileNotFoundError
 from reviewboard.site.models import LocalSite


@@ -367,7 +368,10 @@ class Repository(models.Model):
 revision,
 base_commit_id=base_commit_id)
 else:
-data = self.get_scmtool().get_file(path, revision)
+try:
+data = self.get_scmtool().get_file(path, revision)
+except FileNotFoundError:
+data = self.get_scmtool().get_file(path, base_commit_id)

 log_timer.done()



On Thu, Jun 5, 2014 at 2:50 PM, Bruce Cran bruce.c...@gmail.com wrote:

 I don't know if it used to work with RBTools, but people have said it used
 to work with 'hg postreview -m qparent'.
 Running 'rbt post tip' or 'rbt post --parent=qparent tip' results in
 Review Board saying it can't display the diff where there are changes in a
 file which also has changes in other patches (which, since they haven't
 been pushed yet, are unknown to RB).

 --
 Bruce



 On Thu, Jun 5, 2014 at 2:37 PM, Christian Hammond 
 christ...@beanbaginc.com wrote:

 I don’t know of anything on the RB side that would have changed here. It
 should just accept what’s given by the client. Were you able to do it
 before with RBTools?

 If you’re just trying to post the top-most commit, then (at least with
 Git) you’d do:

 $ rbt post HEAD

 Replace HEAD with whatever you need to identify the particular commit you
 care about. RBTools should take care of calculating the parent for you.




-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using rbt post to review topmost patch of mq series

2014-06-05 Thread Bruce Cran
In 1.7, it was possible to generate a review request of the topmost
changeset patch1 - e.g.:

 hg qapplied
patch1
patch2
patch3
patch4

... by creating a diff of patch2-patch4 and uploading it via the web
interface as the parent diff. How do I do the same in 2.x using 'rbt
post'?  Uploading the top-most patch via --diff-filename doesn't work,
since it doesn't know about the other patches.  Or, is this workflow not
supported?

-- 
Bruce

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using rbt post to review topmost patch of mq series

2014-06-05 Thread Christian Hammond
I don’t know of anything on the RB side that would have changed here. It should 
just accept what’s given by the client. Were you able to do it before with 
RBTools?

If you’re just trying to post the top-most commit, then (at least with Git) 
you’d do:

    $ rbt post HEAD

Replace HEAD with whatever you need to identify the particular commit you care 
about. RBTools should take care of calculating the parent for you.

Christian

-- 
Christian Hammond - christ...@beanbaginc.com
Review Board - http://www.reviewboard.org
Beanbag, Inc. - http://www.beanbaginc.com

On June 5, 2014 at 1:30:51 PM, Bruce Cran (bruce.c...@gmail.com) wrote:

In 1.7, it was possible to generate a review request of the topmost changeset 
patch1 - e.g.:

 hg qapplied
patch1
patch2
patch3
patch4

... by creating a diff of patch2-patch4 and uploading it via the web interface 
as the parent diff. How do I do the same in 2.x using 'rbt post'?  Uploading 
the top-most patch via --diff-filename doesn't work, since it doesn't know 
about the other patches.  Or, is this workflow not supported?

--
Bruce
--
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
---
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using rbt post to review topmost patch of mq series

2014-06-05 Thread Bruce Cran
I don't know if it used to work with RBTools, but people have said it used
to work with 'hg postreview -m qparent'.
Running 'rbt post tip' or 'rbt post --parent=qparent tip' results in Review
Board saying it can't display the diff where there are changes in a file
which also has changes in other patches (which, since they haven't been
pushed yet, are unknown to RB).

-- 
Bruce


On Thu, Jun 5, 2014 at 2:37 PM, Christian Hammond christ...@beanbaginc.com
wrote:

I don’t know of anything on the RB side that would have changed here. It
 should just accept what’s given by the client. Were you able to do it
 before with RBTools?

 If you’re just trying to post the top-most commit, then (at least with
 Git) you’d do:

 $ rbt post HEAD

 Replace HEAD with whatever you need to identify the particular commit you
 care about. RBTools should take care of calculating the parent for you.




-- 
Get the Review Board Power Pack at http://www.reviewboard.org/powerpack/
---
Sign up for Review Board hosting at RBCommons: https://rbcommons.com/
---
Happy user? Let us know at http://www.reviewboard.org/users/
--- 
You received this message because you are subscribed to the Google Groups 
reviewboard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.