Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: AssertionError in "stg uncommit" when going too far back

From: Catalin Marinas <hidden>
Date: 2016-06-15 22:44:21

On 05/03/2008, Pavel Roskin [off-list ref] wrote:
"stg uncommit" causes AssertionError if the number commits to uncommit it too large:

$ stg uncommit -n 10000
Uncommitting 10000 patches ... Traceback (most recent call last):
 File "/home/proski/bin/stg", line 43, in <module>
   main()
 File "home/proski/lib/python2.5/site-packages/stgit/main.py", line 278, in main
 File "home/proski/lib/python2.5/site-packages/stgit/commands/uncommit.py", line 94, in func
 File "home/proski/lib/python2.5/site-packages/stgit/lib/git.py", line 171, in parent
AssertionError
That's on the master branch. I think on the stable one, it used to
report a message like "Commit doesn't have exactly one parent".

In the latest version, we should indeed raise an exception rather than
just assert. I wouldn't declare a new exception class but rather use
an existing one with a meaningful error message. We can't recover from
this anyway and we would simply cancel the operation. I'll let Karl
comment on this as well.

Thanks for reporting it.

-- 
Catalin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help