Re: AssertionError in "stg uncommit" when going too far back
- From
- Catalin Marinas <catalin.marinas@gmail.com>
- Date
- Mar 8, 2008, 12:19 UTC
- Message-ID
- <b0943d9e0803080419y6373ce62xfb108a15203858c7@mail.gmail.com>
- In-Reply-To
- <1204753622.17845.16.camel@dv>
On 05/03/2008, Pavel Roskin <proski@gnu.org> wrote:
Show 10 quoted lines
> "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